diff --git a/app/PaymentDrivers/SquarePaymentDriver.php b/app/PaymentDrivers/SquarePaymentDriver.php index 0acd72e999cf..ca9c10dcb797 100644 --- a/app/PaymentDrivers/SquarePaymentDriver.php +++ b/app/PaymentDrivers/SquarePaymentDriver.php @@ -292,7 +292,7 @@ class SquarePaymentDriver extends BaseDriver if ($api_response->isSuccess()) { //array of WebhookSubscription objects - foreach($api_response->getResult()->getSubscriptions() as $subscription) + foreach($api_response->getResult()->getSubscriptions() ?? [] as $subscription) { if($subscription->getName() == 'Invoice_Ninja_Webhook_Subscription') return $subscription->getId(); @@ -301,7 +301,7 @@ class SquarePaymentDriver extends BaseDriver } else { $errors = $api_response->getErrors(); nlog($errors); - + return false; } return false;