From 4d3eda33fb64a9fc67c337573919dc341d93eaa5 Mon Sep 17 00:00:00 2001 From: Bellord Date: Sun, 19 Jul 2026 16:38:08 +0300 Subject: [PATCH] fix --- lib/Support/SmartFilter.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; }