diff --git a/src/ChainRouter.php b/src/ChainRouter.php index 313baa36..5715ab07 100644 --- a/src/ChainRouter.php +++ b/src/ChainRouter.php @@ -98,7 +98,7 @@ public function add($router, $priority = 0) */ public function all() { - if (0 === count($this->sortedRouters)) { + if (null === $this->sortedRouters || 0 === count($this->sortedRouters)) { $this->sortedRouters = $this->sortRouters(); // setContext() is done here instead of in add() to avoid fatal errors when clearing and warming up caches