diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7d0a1266579..dbd2a0d4444 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -738,11 +738,11 @@ abstract class CommonObject } if ($this->element == 'contact') { $contactid = $this->id; - $thirdpartyid = $object->fk_soc; + $thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc; } if ($this->element == 'user') { $contactid = $this->contact_id; - $thirdpartyid = $object->fk_soc; + $thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc; } $out = '';