Skip to content

foreach() argument must be of type array|object, null given in ShippingAssignmentProcessor.php

I have upgraded Magento from 2.4.3 to 2.4.6-p4, and now I’m getting this exception. Anybody else familiar with this?

[2024-05-09T13:13:54.211477+00:00] main.CRITICAL: Exception: Warning: foreach() argument must be of type array|object, null given in /data/web/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingAssignmentProcessor.php on line 89 in /data/web/magento2/vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
#0 /data/web/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingAssignmentProcessor.php(89): MagentoFrameworkAppErrorHandler->handler()
#1 /data/web/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingAssignmentPersister.php(34): MagentoQuoteModelQuoteShippingAssignmentShippingAssignmentProcessor->save()
#2 /data/web/magento2/vendor/magento/module-quote/Model/QuoteRepository/SaveHandler.php(145): MagentoQuoteModelQuoteShippingAssignmentShippingAssignmentPersister->save()
#3 /data/web/magento2/vendor/magento/module-quote/Model/QuoteRepository/SaveHandler.php(120): MagentoQuoteModelQuoteRepositorySaveHandler->processShippingAssignment()
#4 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): MagentoQuoteModelQuoteRepositorySaveHandler->save()
#5 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): MagentoQuoteModelQuoteRepositorySaveHandlerInterceptor->___callParent()
#6 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): MagentoQuoteModelQuoteRepositorySaveHandlerInterceptor->MagentoFrameworkInterception{closure}()
#7 /data/web/magento2/generated/code/Magento/Quote/Model/QuoteRepository/SaveHandler/Interceptor.php(23): MagentoQuoteModelQuoteRepositorySaveHandlerInterceptor->___callPlugins()
#8 /data/web/magento2/vendor/magento/module-quote/Model/QuoteRepository.php(202): MagentoQuoteModelQuoteRepositorySaveHandlerInterceptor->save()
#9 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): MagentoQuoteModelQuoteRepository->save()
#10 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): MagentoQuoteModelQuoteRepositoryInterceptor->___callParent()
#11 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): MagentoQuoteModelQuoteRepositoryInterceptor->MagentoFrameworkInterception{closure}()
#12 /data/web/magento2/generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(59): MagentoQuoteModelQuoteRepositoryInterceptor->___callPlugins()
#13 /data/web/magento2/app/code/Amasty/CheckoutCore/Model/Quote/CheckoutInitialization.php(259): MagentoQuoteModelQuoteRepositoryInterceptor->save()
#14 /data/web/magento2/app/code/Amasty/CheckoutCore/Plugin/Checkout/Model/DefaultConfigProvider.php(105): AmastyCheckoutCoreModelQuoteCheckoutInitialization->saveInitial()
#15 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(146): AmastyCheckoutCorePluginCheckoutModelDefaultConfigProvider->afterGetConfig()
#16 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): MagentoCheckoutModelDefaultConfigProviderInterceptor->MagentoFrameworkInterception{closure}()
#17 /data/web/magento2/generated/code/Magento/Checkout/Model/DefaultConfigProvider/Interceptor.php(23): MagentoCheckoutModelDefaultConfigProviderInterceptor->___callPlugins()
#18 /data/web/magento2/vendor/magento/module-checkout/Model/CompositeConfigProvider.php(39): MagentoCheckoutModelDefaultConfigProviderInterceptor->getConfig()
#19 /data/web/magento2/vendor/magento/module-checkout/Block/Onepage.php(106): MagentoCheckoutModelCompositeConfigProvider->getConfig()
#20 /data/web/magento2/var/view_preprocessed/pub/static/app/code/Amasty/CheckoutCore/view/frontend/templates/onepage.phtml(16): MagentoCheckoutBlockOnepage->getCheckoutConfig()
#21 /data/web/magento2/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')