Following will cause a fatal error / crash if getProduct() returns null:
if (in_array($productItem->getProduct()->getTypeId(), ['configurable', 'bundle'])) {
Here is a code patch I added above this line so it won't crash as a temporary fix so a single order doesn't prevent a whole batch from failing:
if(!$productItem->getProduct()) { continue; }
Function in question:
private function processOrderItems($orderData, $syncCustomOption)
{
foreach ($orderData->getAllItems() as $productItem) {
// fixes fatal error / crash when getProduct() returns null
if(!$productItem->getProduct()) {
continue;
}
if (in_array($productItem->getProduct()->getTypeId(), ['configurable', 'bundle'])) {
// We store data for configurable and bundle products, to be output alongside their children
unset($parentProductModel, $parentLineItem);
$parentProductModel = $productItem->getProduct();
$parentLineItem = $productItem;
// Custom options stored against parent order items
$customOptions = ($syncCustomOption) ? $this->_getOrderItemOptions($productItem) : [];
continue;
}
...
Hello,
In the following file: Model/Connector/Order.php
Following will cause a fatal error / crash if getProduct() returns null:
if (in_array($productItem->getProduct()->getTypeId(), ['configurable', 'bundle'])) {
Here is a code patch I added above this line so it won't crash as a temporary fix so a single order doesn't prevent a whole batch from failing:
if(!$productItem->getProduct()) { continue; }
Function in question:
Happens on Magento 2.3.3.
Stefan