I am using Magento modal popup for various functionalities in checkout. I am working on an address validation module which fetches the corrected address from USPS API and displays the corrected address as an option in the popup. Now when the user selects the address and clicks on a button which changes the user address and closes the popup, I get the following error.
Uncaught TypeError: Cannot read property 'remove' of null at $.(anonymous function).(anonymous function)._destroyOverlay
This only happens when I close the popup and navigate to the next step at the same time.
But when I close the popup from the close button given by default on the popup, it does not give any error.