Skip to content

Commit

Permalink
Fix null error
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhj committed Aug 4, 2020
1 parent 5e62345 commit 32ec558
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/FrontendIntegration/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ public function checkBeforeUpdateCollection(ProductCollectionItem $item, $set)
public function checkItemIsAvailable(ProductCollectionItem $item)
{
/** @var Product|Model $product */
$product = $item->getProduct();
$product = $item->getProduct();
if (null === $product) {
return null;
}

$productType = $product->getRelated('type');

if (null === $productType || !$productType->stockmanagement_active) {
Expand Down

0 comments on commit 32ec558

Please sign in to comment.