Description
Preconditions (*)
- Magento 2.2. * - 2.3.2
Steps to reproduce (*)
- initiate paypal payment method when shipping address object is not filled with data
Expected result (*)
- no js errors on frontend
- more checks on getShippingAddress method is needed to validate the address object before usage
currently only address.postcode is validated however when other fields are missing like street it expects data to be present while it can be missing
Actual result (*)
- its possible to end up in a state where console logs errors
Uncaught TypeError: Cannot read property '0' of undefined at UiClass.getShippingAddress (/pub/static/version1568411942/frontend/Magento/luma/en_US/Magento_Braintree/js/view/payment/method-renderer/paypal.js:305) at UiClass.getPayPalConfig (/pub/static/version1568411942/frontend/Magento/luma/en_US/Magento_Braintree/js/view/payment/method-renderer/paypal.js:268) at UiClass.initClientConfig (/pub/static/version1568411942/frontend/Magento/luma/en_US/Magento_Braintree/js/view/payment/method-renderer/paypal.js:167) at UiClass.initObservable (/pub/static/version1568411942/frontend/Magento/luma/en_US/Magento_Braintree/js/view/payment/method-renderer/paypal.js:114) at UiClass.initObservable (wrapper.js:109) at UiClass.initialize (element.js:104) at UiClass.initialize (wrapper.js:109) at UiClass._super (wrapper.js:106) at UiClass.initialize (default.js:62) at UiClass.initialize (wrapper.js:109) at UiClass._super (wrapper.js:106) at UiClass.extendingObj.initialize (default.js:21) at UiClass.initialize (wrapper.js:109) at new UiClass (class.js:49) at Object.initComponent (layout.js:137) at fire (jquery.js:3232)