diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 65acf2f4bed7..fcce4dbbb784 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -499,7 +499,7 @@ class Design extends BaseDesign } } elseif (Str::startsWith($variable, '$custom')) { $field = explode('_', $variable); - $visible = property_exists($this->client->company->custom_fields, $field[1]) && !empty($this->client->company->custom_fields->{$field[1]}); + $visible = is_object($this->client->company->custom_fields) && property_exists($this->client->company->custom_fields, $field[1]) && !empty($this->client->company->custom_fields->{$field[1]}); $elements[1]['elements'][] = ['element' => 'div', 'elements' => [ ['element' => 'span', 'content' => $variable . '_label', 'properties' => ['hidden' => !$visible, 'data-ref' => 'totals_table-' . substr($variable, 1) . '-label']],