Skip to content

Commit f5033a5

Browse files
committed
Additional value check added to prevent null values
1 parent fa73689 commit f5033a5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Address.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ class Address {
3838
* @param object $object
3939
*/
4040
public function __construct(object $object) {
41-
if (property_exists($object, "personal")){ $this->personal = $object->personal; }
42-
if (property_exists($object, "mailbox")){ $this->mailbox = $object->mailbox; }
43-
if (property_exists($object, "host")){ $this->host = $object->host; }
44-
if (property_exists($object, "mail")){ $this->mail = $object->mail; }
45-
if (property_exists($object, "full")){ $this->full = $object->full; }
41+
if (property_exists($object, "personal")){ $this->personal = $object->personal ?? ''; }
42+
if (property_exists($object, "mailbox")){ $this->mailbox = $object->mailbox ?? ''; }
43+
if (property_exists($object, "host")){ $this->host = $object->host ?? ''; }
44+
if (property_exists($object, "mail")){ $this->mail = $object->mail ?? ''; }
45+
if (property_exists($object, "full")){ $this->full = $object->full ?? ''; }
4646
}
4747

4848

0 commit comments

Comments
 (0)