From c7cb7c0b680c81046bcc83d87bb4458823fbfc51 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 19 Feb 2024 10:16:48 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B07157=20-=20Add=20robustness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/action.class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/action.class.inc.php b/core/action.class.inc.php index d1f5aa7b3..01b1d997f 100644 --- a/core/action.class.inc.php +++ b/core/action.class.inc.php @@ -470,7 +470,7 @@ class ActionEmail extends ActionNotification return "The objects of the class '$sClass' do not have any email attribute"; } - if(in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) { + if($oTrigger !== null && in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) { $aArgs['trigger_id'] = $oTrigger->GetKey(); $aArgs['action_id'] = $this->GetKey(); @@ -490,7 +490,7 @@ class ActionEmail extends ActionNotification $aRecipients[] = $sAddress; $this->m_iRecipients++; } - if (in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) { + if ($oTrigger !== null && in_array('Contact', MetaModel::EnumParentClasses($sClass, ENUM_CHILD_CLASSES_ALL), true)) { NotificationsService::GetInstance()->RegisterSubscription($oTrigger, $this, $oObj); } }