Skip to content

Commit

Permalink
check if the module exists
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 26, 2018
1 parent ab6ec4e commit c0a1d7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Http/Middleware/AdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ public function handle($request, Closure $next)
foreach ($modules as $module) {
$m = LaravelModule::findByAlias($module->alias);

// Check if the module has settings
if (empty($m->get('settings'))) {
// Check if the module exists and has settings
if (!$m || empty($m->get('settings'))) {
continue;
}

$sub->url('settings/apps/' . $m->getAlias(), title_case(str_replace('_', ' ', snake_case($m->getName()))), $position, $attr);
$sub->url('settings/apps/' . $module->alias, title_case(str_replace('_', ' ', snake_case($m->getName()))), $position, $attr);

$position++;
}
Expand Down

0 comments on commit c0a1d7b

Please sign in to comment.