Skip to content

Commit b9d9ca1

Browse files
authored
Fix empty response crash
1 parent a21b447 commit b9d9ca1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Debugger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class Debugger
3636
public function __construct(Storage $storage, Event $event)
3737
{
3838
$this->storage = $storage;
39-
$this->event = $event;
39+
$this->event = $event;
4040

41-
$this->event->listen(RequestHandled::class, function (RequestHandled $event) {
41+
$this->event->listen(RequestHandled::class, function (RequestHandled $event) {
4242
$this->updateResponse($event->request, $event->response);
4343
});
44-
}
44+
}
4545

4646
/**
4747
* Inject custom collection.
@@ -107,7 +107,7 @@ public function profileMe($name, \Closure $action = null)
107107
protected function updateResponse(Request $request, Response $response)
108108
{
109109
if ($this->needToUpdateResponse($response)) {
110-
$data = $response->getData(true);
110+
$data = $response->getData(true) ?: [];
111111
$data[$this->responseKey] = $this->storage->getData();
112112

113113
$response->setData($data);

0 commit comments

Comments
 (0)