Skip to content

Commit

Permalink
Update Xero.php
Browse files Browse the repository at this point in the history
It is possible for response to be null so ensure we check before calling
  • Loading branch information
tonypartridge authored Jul 22, 2024
1 parent 5d99c9e commit 9b93ae9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Xero.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ protected function guzzle(string $type, string $request, array $data = [], bool
];
} catch (RequestException $e) {
$response = json_decode($e->response->body());
throw new Exception($response->Detail ?? "Type: $response->Type Message: $response->Message Error Number: $response->ErrorNumber");
throw new Exception($response->Detail ?? "Type: $response?->Type Message: $response?->Message Error Number: $response?->ErrorNumber");
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
Expand Down

0 comments on commit 9b93ae9

Please sign in to comment.