Skip to content

Commit 4b65a19

Browse files
authored
Prevent Illegal string offset 'warning_queries'
Prevent Illegal string offset 'warning_queries' exception from not Arrayable responses.
1 parent 6a5689c commit 4b65a19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Outputs/Json.php

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public function output(Collection $detectedQueries, Response $response)
1616
{
1717
if ($response instanceof JsonResponse) {
1818
$data = $response->getData(true);
19+
if (! is_array($data)){
20+
$data = [ $data ];
21+
}
22+
1923
$data['warning_queries'] = $detectedQueries;
2024
$response->setData($data);
2125
}

0 commit comments

Comments
 (0)