Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
parent::getProduct() return null, if this is sometimes correct then <?php if ($product && $product->isSaleable() && $block->isRecurringEnable($product)): ?>
try something like select * from customer_entity where `default_shipping` not in (select entity_id from customer_address_entity) for both default_shipping and default_billing. Once you validate that the result is what you want to fixed then change the sql to update customer_entity set default_shipping = null where `default_shipping` not in (select entity_id from customer_address_entity)
What do you mean by it only affects migrated customers? Take a look at magento.stackexchange.com/questions/196101/… ... you may need to write a SQL script to delete all the address id for the migrated customer since they don't exist in the current magento