From 22914d28ddf52834edddf5a23b353c1c5f837824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 15 Dec 2020 16:59:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Server.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index 964f66dd..88092abf 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -441,8 +441,13 @@ class Server extends Application $attributes->readControllers(CONTROLLER_PATH, 'App\Http\Controllers', 'controllers'); $aliases = $attributes->getAlias('controllers'); + if (count($aliases) < 1) { + return; + } foreach ($aliases as $alias) { - + if (!isset($alias['handler'])) { + continue; + } $handler = $alias['handler']; foreach ($alias['attributes'] as $key => $attribute) { if ($attribute instanceof IAnnotation) { @@ -465,8 +470,13 @@ class Server extends Application $attributes->readControllers(SOCKET_PATH, 'App\Websocket', 'sockets'); $aliases = $attributes->getAlias('sockets'); + if (count($aliases) < 1) { + return; + } foreach ($aliases as $alias) { - + if (!isset($alias['handler'])) { + continue; + } $handler = $alias['handler']; foreach ($alias['attributes'] as $key => $attribute) { if ($attribute instanceof IAnnotation) {