Skip to content

Commit

Permalink
Fixed some minot issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Brecht-Precht committed Mar 9, 2018
1 parent 2209046 commit 96a2105
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Response/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ protected function setBody($body)
return $this;
}
$body = json_decode($body, true);
if (is_null($body)) {
if ($body === null) {
throw new HttpResponseException('Response data is no valid JSON string.');
}
parent::setBody($body);
return $this;
}

/**
* @return array
*/
public function getBody()
{
return parent::getBody();
}

}

0 comments on commit 96a2105

Please sign in to comment.