When using the reorder functionality from the customer account section, the getAllBaseTotalAmounts function on Magento\Quote\Model\Quote\Address\Total returns null, causing the following error if the initial order had Cash on Delivery selected as payment method.
Fatal error: Uncaught TypeError: Argument 1 passed to MSP\CashOnDelivery\Model\Cashondelivery::getBaseAmount() must be of the type array, null given, called in vendor/msp/cashondelivery/Model/Total/Quote/Cashondelivery.php on line 66
The proposed solution calls the getBaseAmount only if the result of that function is not null, if so it assumes the total is 0.
When using the reorder functionality from the customer account section, the getAllBaseTotalAmounts function on Magento\Quote\Model\Quote\Address\Total returns null, causing the following error if the initial order had Cash on Delivery selected as payment method.
Fatal error: Uncaught TypeError: Argument 1 passed to MSP\CashOnDelivery\Model\Cashondelivery::getBaseAmount() must be of the type array, null given, called in vendor/msp/cashondelivery/Model/Total/Quote/Cashondelivery.php on line 66
The proposed solution calls the getBaseAmount only if the result of that function is not null, if so it assumes the total is 0.