From 9fb5b95b5ee0e9d269bc6982393966062b646509 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 7 Jan 2023 19:54:59 +0100 Subject: [PATCH] Fix other foreach() troubles at Addon.php --- src/Core/Addon.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Core/Addon.php b/src/Core/Addon.php index 976b9799b..46ba0eec2 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -196,6 +196,10 @@ class Addon { $addons = DI::config()->get('addons'); + if (empty($addons)) { + return; + } + foreach ($addons as $name => $data) { $addonname = Strings::sanitizeFilePathItem(trim($name)); $addon_file_path = 'addon/' . $addonname . '/' . $addonname . '.php'; @@ -318,6 +322,11 @@ class Addon { $visible_addons = []; $addons = DI::config()->get('addons'); + + if (empty($addons)) { + return $visible_addons; + } + foreach ($addons as $name => $data) { $visible_addons[] = $name; }