1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Check for properties before accessing

This commit is contained in:
David Bomba 2022-12-07 12:21:12 +11:00
parent ea5588e1e7
commit 9d0ba8d30a

View File

@ -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;