Menu: Swallow silently any DB issue in the main menu

This commit is contained in:
Yonas Habteab 2022-04-08 10:27:35 +02:00
parent fd9c547dde
commit 945a69f0cd

View File

@ -165,6 +165,7 @@ class Menu extends Navigation
$homes = Home::on(Dashboard::getConn());
$homes->filter(Filter::equal('username', $user->getUsername()));
try {
foreach ($homes as $home) {
$dashboardHome = new DashboardHomeItem($home->name, [
'uuid' => $home->id,
@ -175,6 +176,11 @@ class Menu extends Navigation
$dashboardItem->addChild($dashboardHome);
}
} catch (\Exception $_) {
// Nothing to do
// Any database issue will be noticed soon enough, so prevent the Menu
// from being ruined in any case.
}
}
/**