diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 4e88ce5a0..ed961594e 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1737,7 +1737,7 @@ class Page if (isset($routes[$uri_path])) { $child_page = $pages->dispatch($uri->route())->parent(); - while (!$child_page->root()) { + if ($child_page) while (!$child_page->root()) { if ($this->path() == $child_page->path()) { return true; }