Skip to content

Commit 6b54af7

Browse files
author
Thomas Jarrand
committed
Fix active state for menu
1 parent aa97f5d commit 6b54af7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Menu/Builder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,19 @@ private function resolve(array $item, array $keys)
6565

6666
public function isCurrentRoot(?string $root): bool
6767
{
68+
if (is_null($root)) {
69+
return false;
70+
}
71+
6872
return $this->getCurrentAttribute('_menu_root') === $root;
6973
}
7074

7175
public function isCurrentBranch(?string $branch): bool
7276
{
77+
if (is_null($branch)) {
78+
return false;
79+
}
80+
7381
return $this->getCurrentAttribute('_menu_branch') === $branch;
7482
}
7583

0 commit comments

Comments
 (0)