From 7b234694533da44bac2402fa2c4650d54fab9ac9 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 2 Feb 2024 14:03:03 +0100 Subject: [PATCH] avoid crashing when preparing old notifications that don't have a target Signed-off-by: Julien Veyssier --- lib/Notification/Notifier.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 21995190..e6f6fa23 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -63,6 +63,11 @@ public function prepare(INotification $notification, string $languageCode): INot $l = $this->factory->get(Application::APP_ID, $languageCode); $params = $notification->getSubjectParameters(); + // ignore old notifications (before meta tasks were introduced) + // isset returns false if null + if (!isset($params['target'], $params['taskCategory'], $params['inputs'])) { + throw new InvalidArgumentException(); + } $schedulingAppId = $params['appId']; $schedulingAppInfo = $this->appManager->getAppInfo($schedulingAppId); if ($schedulingAppInfo === null) {