From 344dd839e669b27b1a5d0901a7de8897e0e07859 Mon Sep 17 00:00:00 2001 From: Chris Ware Date: Tue, 18 Feb 2020 13:04:29 +0000 Subject: [PATCH] Catch error not being set on response data array --- src/Provider/Xero.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/Xero.php b/src/Provider/Xero.php index f79e6eb..17675fa 100644 --- a/src/Provider/Xero.php +++ b/src/Provider/Xero.php @@ -130,7 +130,7 @@ protected function checkResponse(ResponseInterface $response, $data) { if ($response->getStatusCode() >= 400) { throw new XeroProviderException( - $data['error'] ?: $response->getReasonPhrase(), + isset($data['error']) ? $data['error'] : $response->getReasonPhrase(), $response->getStatusCode(), $response );