diff --git a/src/Server/WebSocket/Middleware/HandShakeMiddleware.php b/src/Server/WebSocket/Middleware/HandShakeMiddleware.php index bd7c3a46c1..1f28392335 100644 --- a/src/Server/WebSocket/Middleware/HandShakeMiddleware.php +++ b/src/Server/WebSocket/Middleware/HandShakeMiddleware.php @@ -26,7 +26,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface { /** @var \Imi\Server\Http\Route\RouteResult $routeResult */ $routeResult = RequestContext::get('routeResult'); - if($routeResult->routeItem->wsConfig->wsOnly) + if($routeResult->routeItem->wsConfig->wsOnly ?? false) { $response = $response->withStatus(StatusCode::BAD_REQUEST); }