Skip to content

Commit 11be192

Browse files
BenjaminBenjamin
authored andcommitted
Added check for invalid responses which are not empty.
1 parent d4e03fd commit 11be192

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Parse/ParseClient.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ public static function _request(
493493
}
494494

495495
$decoded = json_decode($response, true);
496+
497+
if(!isset($decoded) && $response !== '') {
498+
throw new ParseException('Bad Request. Could not decode Response', -1);
499+
500+
}
501+
496502
if (isset($decoded['error'])) {
497503
// check to convert error to a string, if an array
498504
// used to handle an Array 'error' from back4app.com

0 commit comments

Comments
 (0)