diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 85518949..f0144303 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -401,6 +401,7 @@ class Node extends HttpService */ public function addMiddleware(Closure|string|array $class) { + if (empty($class)) return; if (is_string($class)) { $class = Snowflake::createObject($class); if (!($class instanceof \HttpServer\IInterface\Middleware)) {