From: Aidan Saunders Date: Mon, 5 Nov 2018 18:08:32 +0000 (+0000) Subject: Prevent evaluate() erroring when no contactId is given. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d4afa032ab68997605508694b8ab7092cec7daac;p=civicrm-core.git Prevent evaluate() erroring when no contactId is given. --- diff --git a/Civi/Token/TokenCompatSubscriber.php b/Civi/Token/TokenCompatSubscriber.php index 8e2ac735ba..b4b41cfdab 100644 --- a/Civi/Token/TokenCompatSubscriber.php +++ b/Civi/Token/TokenCompatSubscriber.php @@ -49,6 +49,9 @@ class TokenCompatSubscriber implements EventSubscriberInterface { $messageTokens = $e->getTokenProcessor()->getMessageTokens(); foreach ($e->getRows() as $row) { + if (empty($row->context['contactId'])) { + continue; + } /** @var int $contactId */ $contactId = $row->context['contactId']; if (empty($row->context['contact'])) {