diff --git a/HttpServer/Route/Dispatch/Dispatch.php b/HttpServer/Route/Dispatch/Dispatch.php index 4313da72..25213747 100644 --- a/HttpServer/Route/Dispatch/Dispatch.php +++ b/HttpServer/Route/Dispatch/Dispatch.php @@ -65,11 +65,11 @@ class Dispatch * @param $controller * @return mixed */ - protected function bindRequest($controller) + protected function bindRequest($controller): mixed { $controller->request = Context::getContext('request'); - $controller->headers = $controller->request->headers; - $controller->input = $controller->request->params; + $controller->headers = $controller->request?->headers; + $controller->input = $controller->request?->params; return $controller; }