]> _ Git - cubedesigners_userdatabase.git/commitdiff
fix #6199
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 25 Aug 2023 13:51:47 +0000 (15:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 25 Aug 2023 13:51:47 +0000 (15:51 +0200)
src/app/Models/Company.php

index eaab74107634ce878b25a637e3904ffda2059cc5..ff465de10acc0c51786506e2675bc62ddf6f3230 100644 (file)
@@ -247,6 +247,10 @@ class Company extends CubistMagicAbstractModel
 
     protected function setComposedAttributes()
     {
+        if (null === $this->billing_address) {
+            $this->billing_address = [];
+        }
+        $this->billing_address = array_merge(['name' => '', 'address' => '', 'postcode' => '', 'city' => '', 'country' => ''], $this->billing_address);
         $billingAddress = ($this->billing_address['name'] ?: $this->name) . "\n";
         $billingAddress .= ($this->billing_address['address'] ?: $this->address['address']) . "\n";
         $billingAddress .= ($this->billing_address['postcode'] ?: $this->address['postcode']) . ' ' . ($this->billing_address['city'] ?: $this->address['city']) . "\n";