Skip to content

Commit 1dc8271

Browse files
authored
Merge pull request #166 from nextcloud/fix/noid/missing-tasktype-notifier
fix(notifier): check if task type is there before getting its name
2 parents 6cf75fd + b2ee509 commit 1dc8271

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Notification/Notifier.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ public function prepare(INotification $notification, string $languageCode): INot
9595
$taskInput = $l->t('Writing style: %1$s; Source material: %2$s', [$params['inputs']['writingStyle'], $params['inputs']['sourceMaterial']]);
9696
} else {
9797
$availableTaskTypes = $this->taskProcessingManager->getAvailableTaskTypes();
98-
$taskType = $availableTaskTypes[$params['taskTypeId']];
99-
$taskTypeName = $taskType['name'];
98+
if (isset($availableTaskTypes[$params['taskTypeId']])) {
99+
$taskType = $availableTaskTypes[$params['taskTypeId']];
100+
$taskTypeName = $taskType['name'];
101+
}
100102
}
101103
} catch (\Exception | \Throwable $e) {
102104
$this->logger->debug('Impossible to get task type ' . $params['taskTypeId'], ['exception' => $e]);

0 commit comments

Comments
 (0)