diff --git a/Model/Autocomplete/DataProviderHelper.php b/Model/Autocomplete/DataProviderHelper.php index aacfb12d..e8048cf5 100644 --- a/Model/Autocomplete/DataProviderHelper.php +++ b/Model/Autocomplete/DataProviderHelper.php @@ -144,10 +144,12 @@ public function getProductItems(AutocompleteProductResponseInterface $response) $result = []; foreach ($response->getProductData() as $item) { $product = $productCollection->getItemById($item['id']); - $product->setData('tweakwise_price', $item['tweakwise_price']); + if (!$product) { continue; } + + $product->setData('tweakwise_price', $item['tweakwise_price']); $result[] = $this->productItemFactory->create(['product' => $product]); }