From 451a1c0576b0fb57b29da2ab4536dc7a080c248e Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 1 Jan 2015 20:27:45 +0000 Subject: [PATCH] Trying to stop not set error... --- src/pjdietz/WellRESTed/Router.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pjdietz/WellRESTed/Router.php b/src/pjdietz/WellRESTed/Router.php index ddc6824..0675b15 100644 --- a/src/pjdietz/WellRESTed/Router.php +++ b/src/pjdietz/WellRESTed/Router.php @@ -44,7 +44,6 @@ class Router implements HandlerInterface */ public function getResponse(RequestInterface $request, array $args = null) { - $response = null; $path = $request->getPath(); if (array_key_exists($path, $this->routes)) { $handler = new $this->routes[$path](); @@ -65,7 +64,7 @@ class Router implements HandlerInterface } } } - if ($response) { + if (isset($response) and $response) { // Check if the router has an error handler for this status code. $status = $response->getStatusCode(); if (array_key_exists($status, $this->errorHandlers)) {