From 9d039c9a681b4a67632349f8cce99db248dc781d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfred=20B=C3=BChler?= Date: Mon, 5 Aug 2024 15:47:11 +0200 Subject: [PATCH] Ignore unknown task_id for notifications. --- Console/TaskMailNotify.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Console/TaskMailNotify.php b/Console/TaskMailNotify.php index 2acaf34..3676e1a 100644 --- a/Console/TaskMailNotify.php +++ b/Console/TaskMailNotify.php @@ -23,10 +23,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $tasks = array(); $emails = $this->helper->mailHelper->checkMailBox(); - // FIXME invalid Task# $tasks = array(); foreach ($emails as $email) { - $task = $this->taskFinderModel->getById($email['task_id']); + if (($task = $this->taskFinderModel->getById($email['task_id'])) == null) continue; $task['project_name'] = $this->projectModel->getById($task['project_id'])['name']; $task['email'] = $email['email']; $tasks[] = $task;