From 2c980bcd53cd34a766dd542609dd2b92999e5cd9 Mon Sep 17 00:00:00 2001 From: Leonardo Pedretti Date: Wed, 24 Jan 2018 14:10:54 -0300 Subject: [PATCH] don't throw errors if the contact id is null --- src/Resources/BareResource.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/BareResource.php b/src/Resources/BareResource.php index f08e92f..e9bf70e 100644 --- a/src/Resources/BareResource.php +++ b/src/Resources/BareResource.php @@ -90,7 +90,8 @@ public function __construct($entry, $translateTimestamps = true) case 'contact_type_id': $contactTypes = CRM::fieldList('contactType'); - $this->contact_type = $contactTypes[$entry['contact_type_id']]; + if (!empty($entry['contact_type_id'])) + $this->contact_type = $contactTypes[$entry['contact_type_id']]; break; default: