From 9d0ba8d30a94938c256a19724b24c38877e03544 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 7 Dec 2022 12:21:12 +1100 Subject: [PATCH] Check for properties before accessing --- app/Utils/Traits/GeneratesCounter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Utils/Traits/GeneratesCounter.php b/app/Utils/Traits/GeneratesCounter.php index 533b5b60dd..1ea15dde0c 100644 --- a/app/Utils/Traits/GeneratesCounter.php +++ b/app/Utils/Traits/GeneratesCounter.php @@ -60,7 +60,7 @@ trait GeneratesCounter $counter_entity = $client; } elseif ((strpos($pattern, 'groupCounter') !== false) || (strpos($pattern, 'group_counter') !== false)) { - if (property_exists($client->group_settings, $counter_string)) { + if (property_exists($client, 'group_settings') && property_exists($client->group_settings, $counter_string)) { $counter = $client->group_settings->{$counter_string}; } else { $counter = 1;