From f769508984fb0e709ec89dc38490e967847647be Mon Sep 17 00:00:00 2001 From: mirzaev Date: Thu, 4 Jan 2024 23:19:26 +0700 Subject: [PATCH] null in foreach fix --- mirzaev/site/repression/system/models/views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirzaev/site/repression/system/models/views.php b/mirzaev/site/repression/system/models/views.php index 98e1a43..5a0a394 100755 --- a/mirzaev/site/repression/system/models/views.php +++ b/mirzaev/site/repression/system/models/views.php @@ -201,7 +201,7 @@ class views extends core $buffer = []; // Обработка последних просмотров - foreach ($response as $view) $buffer[] = $view->getAll()[0]; + foreach ($response ?? [] as $view) $buffer[] = $view->getAll()[0]; return $buffer; } else throw new exception('Не удалось инициализировать коллекцию');