diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index bf8c434a..b8ea22c1 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -391,6 +391,7 @@ class Node extends HttpService */ public function addMiddleware(Closure|string|array $class): static { + if (empty($class)) return $this; if (is_string($class)) { $class = $this->resolve_aop($class); if ($class === null) {