Wrap getConn() into a try catch to prevent the menu from being broken

This commit is contained in:
Yonas Habteab 2022-04-08 16:51:49 +02:00
parent a1ed493ad1
commit 217faab3fc

View File

@ -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,