diff --git a/http-helper/Route/Router.php b/http-helper/Route/Router.php index 59db754f..c9003f06 100644 --- a/http-helper/Route/Router.php +++ b/http-helper/Route/Router.php @@ -401,11 +401,8 @@ class Router extends HttpService implements RouterInterface */ public function tree_search(?array $explode): ?Node { - if (empty($this->nodes)) { - return null; - } - $parent = $this->nodes[$explode] ?? null; - if (!($parent instanceof Node)) { + $parent = $this->nodes[array_shift($explode)] ?? null; + if (is_null($parent)) { return null; } while ($value = array_shift($explode)) {