Skip to content

Commit

Permalink
fix(notifier): check if task type is there before getting its name
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Dec 18, 2024
1 parent 6cf75fd commit b2ee509
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 b2ee509

Please sign in to comment.