diff --git a/lib/Support/SmartFilter.php b/lib/Support/SmartFilter.php index da4e02f..e973a86 100644 --- a/lib/Support/SmartFilter.php +++ b/lib/Support/SmartFilter.php @@ -65,11 +65,17 @@ class SmartFilter { //pre('getPreparedItems ' . ($deleteOffersProps?'true':'false')); $af = app()->factory()->iBlock()->getEntityById($iBlockId); + if(!$af){ + return $items; + } $iBlockFactory = app()->factory()->main()->getIBlockFactory(); $iBlockEntity = $iBlockFactory->getEntityById($iBlockId); $propertyFactory = $af->getPropertyFactory(); - if(!$iBlockEntity->getCatalogEntity()->hasOffers()) { + if(!$iBlockEntity){ + return $items; + } + if(!$iBlockEntity?->getCatalogEntity()?->hasOffers()) { return $items; }