Skip to content

Commit

Permalink
Merge pull request #166 from nextcloud/fix/noid/missing-tasktype-noti…
Browse files Browse the repository at this point in the history
…fier

fix(notifier): check if task type is there before getting its name
  • Loading branch information
julien-nc authored Dec 18, 2024
2 parents 6cf75fd + b2ee509 commit 1dc8271
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ public function prepare(INotification $notification, string $languageCode): INot
$taskInput = $l->t('Writing style: %1$s; Source material: %2$s', [$params['inputs']['writingStyle'], $params['inputs']['sourceMaterial']]);
} else {
$availableTaskTypes = $this->taskProcessingManager->getAvailableTaskTypes();
$taskType = $availableTaskTypes[$params['taskTypeId']];
$taskTypeName = $taskType['name'];
if (isset($availableTaskTypes[$params['taskTypeId']])) {
$taskType = $availableTaskTypes[$params['taskTypeId']];
$taskTypeName = $taskType['name'];
}
}
} catch (\Exception | \Throwable $e) {
$this->logger->debug('Impossible to get task type ' . $params['taskTypeId'], ['exception' => $e]);
Expand Down

0 comments on commit 1dc8271

Please sign in to comment.