Skip to content

Commit

Permalink
Menu: Add link can fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Jul 26, 2021
1 parent 90c57f3 commit 954906f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Menu/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ final class Menu

public function addLink(string $label, string $url, ?string $group = null): void
{
$this->items[$this->registerGroup($group)][] = new MenuLink($label, $url);
try {
$this->items[$this->registerGroup($group)][] = new MenuLink($label, $url);
} catch (\InvalidArgumentException $e) {
trigger_error(__METHOD__ . ': ' . $e->getMessage());
}
}


Expand Down

0 comments on commit 954906f

Please sign in to comment.