From 217faab3fcc5611ba6b6c4642c130fc80a119932 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 8 Apr 2022 16:51:49 +0200 Subject: [PATCH] Wrap getConn() into a try catch to prevent the menu from being broken --- library/Icinga/Web/Menu.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 6c0bd4ab6..954ebbc5a 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -160,10 +160,10 @@ class Menu extends Navigation $user = Dashboard::getUser(); $dashboardItem = $this->getItem('dashboard'); - $homes = Home::on(Dashboard::getConn()); - $homes->filter(Filter::equal('username', $user->getUsername())); - try { + $homes = Home::on(Dashboard::getConn()); + $homes->filter(Filter::equal('username', $user->getUsername())); + foreach ($homes as $home) { $dashboardHome = new DashboardHomeItem($home->name, [ 'uuid' => $home->id,