From e08d0c00f4e1a1c063a5876f856902bb47de154c Mon Sep 17 00:00:00 2001
From: "@ChristelLoftus" <christel@bob.co.za>
Date: Wed, 2 Apr 2025 11:58:31 +0200
Subject: [PATCH 1/2] #19 - prevent null values for allowed methods

---
 Model/Carrier/BobGo.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Model/Carrier/BobGo.php b/Model/Carrier/BobGo.php
index d269be1..938e847 100644
--- a/Model/Carrier/BobGo.php
+++ b/Model/Carrier/BobGo.php
@@ -535,7 +535,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
     public function getAllowedMethods(): array
     {
         $allowedMethods = $this->getConfigData('allowed_methods');
-        if ($allowedMethods === false) {
+        if ($allowedMethods === false || $allowedMethods === null || trim($allowedMethods) === '') {
             return []; // Return an empty array if no allowed methods are configured
         }
 
-- 
GitLab


From 9a2c1137a6dde6ed5d3c2369017a375a1b3ad156 Mon Sep 17 00:00:00 2001
From: "@ChristelLoftus" <christel@bob.co.za>
Date: Fri, 4 Apr 2025 07:52:45 +0200
Subject: [PATCH 2/2] #19 - use if empty instead to cater for all 3 checks

---
 Model/Carrier/BobGo.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Model/Carrier/BobGo.php b/Model/Carrier/BobGo.php
index 938e847..12e46e6 100644
--- a/Model/Carrier/BobGo.php
+++ b/Model/Carrier/BobGo.php
@@ -535,7 +535,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
     public function getAllowedMethods(): array
     {
         $allowedMethods = $this->getConfigData('allowed_methods');
-        if ($allowedMethods === false || $allowedMethods === null || trim($allowedMethods) === '') {
+        if (empty($allowedMethods)) {
             return []; // Return an empty array if no allowed methods are configured
         }
 
-- 
GitLab