From d4afa032ab68997605508694b8ab7092cec7daac Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Mon, 5 Nov 2018 18:08:32 +0000 Subject: [PATCH] Prevent evaluate() erroring when no contactId is given. --- Civi/Token/TokenCompatSubscriber.php | 3 +++ 1 file changed, 3 insertions(+) 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'])) { -- 2.25.1