From 7f484f4d5c58ff88a869428cff1267eef012bac7 Mon Sep 17 00:00:00 2001 From: wdammak Date: Sat, 24 Aug 2024 01:21:35 +0100 Subject: [PATCH] Fix Trying to access array offset on value of type bool PHP Notice: Trying to access array offset on value of type bool --- classes/shop/ShopUrl.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/shop/ShopUrl.php b/classes/shop/ShopUrl.php index fcb6d5b06..7e5011cae 100644 --- a/classes/shop/ShopUrl.php +++ b/classes/shop/ShopUrl.php @@ -167,8 +167,13 @@ class ShopUrlCore extends ObjectModel FROM '._DB_PREFIX_.'shop_url WHERE main = 1 AND id_shop = '.($id_shop !== null ? (int)$id_shop : (int)Context::getContext()->shop->id)); - self::$main_domain[(int)$id_shop] = $row['domain']; - self::$main_domain_ssl[(int)$id_shop] = $row['domain_ssl']; + if ($row && is_array($row)) { + self::$main_domain[(int)$id_shop] = $row['domain']; + self::$main_domain_ssl[(int)$id_shop] = $row['domain_ssl']; + } else { + self::$main_domain[(int)$id_shop] = null; + self::$main_domain_ssl[(int)$id_shop] = null; + } } }