We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6bb3a81 commit 5ecfddeCopy full SHA for 5ecfdde
src/Auspost.php
@@ -474,6 +474,10 @@ private function closeSocket() {
474
* @return array associative array
475
*/
476
private function convertResponse($data) {
477
- return json_decode($data, true);
+ $response = json_decode($data, true);
478
+ if ($data && is_null($response)) {
479
+ throw new \Exception('Could not decode response');
480
+ }
481
+ return $response;
482
}
483
0 commit comments