emartech / magento2-extension

Emarsys Magento2 Extension
MIT License
11 stars 9 forks source link

Added default value for setPostCode in CustomerAddressInterface and C… #31

Closed lucacanella closed 1 year ago

lucacanella commented 1 year ago

…ustomerAddress to prevent error when handleAddressWebsiteData returns null for 'postcode'.

Tested only on a specific instance, where a null postcode was returned here https://github.com/emartech/magento2-extension/blob/570f7288daadee6c5008e705a0121e4fe07a32b7/Helper/Customer.php#L691 causing a persistent error in contacts synchronization.

lucacanella commented 1 year ago

Thank you very much for your pull request!

This is not enough and not good enough. If we allow the postcode to be null in the setter, then the getter can also have a null return value

You're right, I added the nullable type in the getters (comments included). Let me know if this is ok.