Skip to content

Commit 47d808c

Browse files
committed
check if response from guzzle is a array
1 parent a12c5f7 commit 47d808c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/EtherpadLite/Response.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ public function __construct(\Guzzle\Http\Message\Response $response)
2020
if ($response->isSuccessful()) {
2121
$this->response = $response->json();
2222

23-
foreach ($this->response as $key => $value) {
24-
$this->response[$key] = $value;
23+
if (is_array($this->response)) {
24+
foreach ($this->response as $key => $value) {
25+
$this->response[$key] = $value;
26+
}
2527
}
2628
} else {
2729
// TODO: Error handling
@@ -61,4 +63,4 @@ public function getResponse()
6163
{
6264
return $this->response;
6365
}
64-
}
66+
}

0 commit comments

Comments
 (0)