Skip to content

Commit

Permalink
Update Contact.php
Browse files Browse the repository at this point in the history
Handle unset types property
  • Loading branch information
mvdgeijn authored Mar 4, 2024
1 parent 2169da5 commit 6b4cfef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Responses/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Contact extends AbstractResponse

protected Carbon $createdDate;

protected ContactType $types;
protected ?ContactType $types = null;

/**
* Create contact array for contact:create request
Expand Down Expand Up @@ -197,7 +197,10 @@ public function setTypes( $types ): Contact
*/
public function getTypes(): ContactType
{
return $this->types;
if( $this->types == null )
return new ContactType();
else
return $this->types;
}

/**
Expand Down

0 comments on commit 6b4cfef

Please sign in to comment.