diff --git a/src/Views/top-navigation.phtml b/src/Views/top-navigation.phtml
index fa52ab80..bfd4a330 100644
--- a/src/Views/top-navigation.phtml
+++ b/src/Views/top-navigation.phtml
@@ -2,8 +2,16 @@
context->route->simpleControllerName;
- $activeAction = $this->context->route->simpleActionName;
+ if ($this->context->route)
+ {
+ $activeController = $this->context->route->simpleControllerName;
+ $activeAction = $this->context->route->simpleActionName;
+ }
+ else
+ {
+ $activeController = null;
+ $activeAction = null;
+ }
$registerNavItem = function ($text, $link, $active = false) use (&$nav)
{