Skip to content

Commit 9264d4b

Browse files
If parent product data is null, don't fetch parent data (#477)
1 parent 5534692 commit 9264d4b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Meta/Catalog/Model/CatalogUpdateHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ private function processUpdates(Collection $productUpdates, $storeId, string $ca
204204
foreach ($products as $product) {
205205
if (isset($productLinks[$product->getId()])) {
206206
$parentProduct = $parentProducts->getItemById($productLinks[$product->getId()]);
207-
$product = $this->productRepository->loadParentProductData($product, $parentProduct);
207+
if ($parentProduct) {
208+
$product = $this->productRepository->loadParentProductData($product, $parentProduct);
209+
}
208210
}
209211
if ($product->getSendToFacebook() === false) {
210212
continue;

0 commit comments

Comments
 (0)