Commit 15731d08 authored by Marco Descher's avatar Marco Descher 🏔

[16645] Consider taskDescriptor == null

parent d44960d7
Pipeline #11500 passed with stages
in 4 minutes and 33 seconds
......@@ -259,15 +259,19 @@ public class TaskServiceImpl implements ITaskService {
ITaskDescriptor taskDescriptor =
findTaskDescriptorByIdOrReferenceId(task.getDescriptorId()).orElse(null);
OwnerTaskNotification ownerNotification = taskDescriptor.getOwnerNotification();
TaskState state = task.getState();
if (OwnerTaskNotification.WHEN_FINISHED == ownerNotification
|| (OwnerTaskNotification.WHEN_FINISHED_FAILED == ownerNotification
&& TaskState.FAILED == state)) {
sendMessageToOwner(task, taskDescriptor.getOwner(), state);
}
if(taskDescriptor != null) {
OwnerTaskNotification ownerNotification = taskDescriptor.getOwnerNotification();
IUser owner = taskDescriptor.getOwner();
TaskState state = task.getState();
if (OwnerTaskNotification.WHEN_FINISHED == ownerNotification
|| (OwnerTaskNotification.WHEN_FINISHED_FAILED == ownerNotification
&& TaskState.FAILED == state)) {
sendMessageToOwner(task, owner, state);
}
} else {
logger.error("could not load taskdescriptor by id [{}]", task.getDescriptorId());
}
}
logger.debug("notify {}", task);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment