mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-30 20:30:43 +01:00
Prevent an error when there are no pages in the site
This commit is contained in:
@@ -646,8 +646,11 @@ class Admin
|
||||
$route = '/' . ltrim(Grav::instance()['admin']->route, '/');
|
||||
|
||||
$page = $pages->dispatch($route);
|
||||
$parent = $page->parent();
|
||||
$parent_route = $parent->rawRoute();
|
||||
$parent_route = null;
|
||||
if ($page) {
|
||||
$parent = $page->parent();
|
||||
$parent_route = $parent->rawRoute();
|
||||
}
|
||||
|
||||
return $parent_route;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user