From c9c98b403c913bb0d68fc0065ba191e8038de4e4 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Thu, 22 Sep 2022 15:26:31 +0200 Subject: [PATCH] Fix possible undefined index access [MAILPOET-4629] --- mailpoet/lib/Automation/Engine/Control/StepHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailpoet/lib/Automation/Engine/Control/StepHandler.php b/mailpoet/lib/Automation/Engine/Control/StepHandler.php index 53c2e18b64..be58a167de 100644 --- a/mailpoet/lib/Automation/Engine/Control/StepHandler.php +++ b/mailpoet/lib/Automation/Engine/Control/StepHandler.php @@ -181,7 +181,7 @@ class StepHandler { private function getSubjectEntries(WorkflowRun $workflowRun, array $requiredSubjectKeys): array { $subjectDataMap = []; foreach ($workflowRun->getSubjects() as $data) { - $subjectDataMap[$data->getKey()] = array_merge($subjectDataMap[$data->getKey()], [$data]); + $subjectDataMap[$data->getKey()] = array_merge($subjectDataMap[$data->getKey()] ?? [], [$data]); } $subjectEntries = [];