From 9b93ae9cecc05ca2d7c0ed78f1a959c7861430a2 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Mon, 22 Jul 2024 09:13:32 +0100 Subject: [PATCH] Update Xero.php It is possible for response to be null so ensure we check before calling --- src/Xero.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xero.php b/src/Xero.php index a692a86..b6bbed8 100755 --- a/src/Xero.php +++ b/src/Xero.php @@ -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()); }