diff --git a/lib/Listener/TaskProcessingListener.php b/lib/Listener/TaskProcessingListener.php index a71bed6e9a..0097a2e6c0 100644 --- a/lib/Listener/TaskProcessingListener.php +++ b/lib/Listener/TaskProcessingListener.php @@ -44,9 +44,21 @@ public function handle(Event $event): void { return; } - [$type, $id] = explode(':', $task->getCustomId()); - $userId = $task->getUserId(); - $summary = $task->getOutput()['output']; + if ($task->getCustomId() !== null) { + [$type, $id] = explode(':', $task->getCustomId()); + } else { + $this->logger->info('Error handling task processing event custom id missing'); + } + if ($task->getUserId() !== null) { + $userId = $task->getUserId(); + } else { + $this->logger->info('Error handling task processing event user id missing'); + } + if ($task->getOutput() !== null && isset($task->getOutput()['output'])) { + $summary = $task->getOutput()['output']; + } else { + $this->logger->info('Error handling task processing event output missing'); + } if ($type === 'message') { $this->handleMessageSummary($userId, (int)$id, $summary); diff --git a/lib/Service/AiIntegrations/AiIntegrationsService.php b/lib/Service/AiIntegrations/AiIntegrationsService.php index 3849f2f01d..4b92e4e6ad 100644 --- a/lib/Service/AiIntegrations/AiIntegrationsService.php +++ b/lib/Service/AiIntegrations/AiIntegrationsService.php @@ -63,11 +63,8 @@ public function __construct( * * @param Account $account * @param array $messages - * @param Horde_Imap_Client_Socket $client * - * @return null|string - * - * @throws ServiceException + * @return void */ public function summarizeMessages(Account $account, array $messages): void { try {