From 7df47835a2535ff1b5e273ef1de8f337da6fea13 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 3 Nov 2021 11:55:45 +1100 Subject: [PATCH] Check for country on client as first check --- app/Models/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Client.php b/app/Models/Client.php index 520bd5f59857..55ac5fe02471 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -530,7 +530,7 @@ class Client extends BaseModel implements HasLocalePreference } } - if ($this->country->iso_3166_3 == 'GBR' && in_array(GatewayType::DIRECT_DEBIT, array_column($pms, 'gateway_type_id'))) { + if ($this->country && $this->country->iso_3166_3 == 'GBR' && in_array(GatewayType::DIRECT_DEBIT, array_column($pms, 'gateway_type_id'))) { foreach ($pms as $pm) { if ($pm['gateway_type_id'] == GatewayType::DIRECT_DEBIT) { $cg = CompanyGateway::find($pm['company_gateway_id']);