Skip to content

Commit

Permalink
response can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed May 17, 2018
1 parent 8c92388 commit 1fc78fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/Middleware/DebugBarMiddleware.php
Expand Up @@ -14,7 +14,9 @@ public function process(HTTPRequest $request, callable $delegate)
{
$this->beforeRequest($request);
$response = $delegate($request);
$this->afterRequest($request, $response);
if($response) {
$this->afterRequest($request, $response);
}
return $response;
}

Expand Down Expand Up @@ -51,7 +53,7 @@ protected function beforeRequest(HTTPRequest $request)
* @param HTTPRequest $request
* @param HTTPResponse $response
*/
protected function afterRequest(HTTPRequest $request, HTTPResponse $response = null)
protected function afterRequest(HTTPRequest $request, HTTPResponse $response)
{
$debugbar = DebugBar::getDebugBar();
if (!$debugbar) {
Expand Down

0 comments on commit 1fc78fe

Please sign in to comment.