diff --git a/src/Menu/Items/ItemList.php b/src/Menu/Items/ItemList.php index 5953556..f5d6a65 100644 --- a/src/Menu/Items/ItemList.php +++ b/src/Menu/Items/ItemList.php @@ -495,8 +495,10 @@ public function getItemListsAtDepthRange($from, $to) public function getItemsAtDepth($depth) { $itemsWithDepth = $this->getItemsWithDepth(); - - return new MenuHandler($itemsWithDepth[$depth]); + if (array_key_exists($depth, $itemsWithDepth)) { + return new MenuHandler($itemsWithDepth[$depth]); + } + return new MenuHandler(array()); } /**