Skip to content

Commit

Permalink
Fix NPE in GUI
Browse files Browse the repository at this point in the history
(cherry picked and adapted from commit bfffb7f)
  • Loading branch information
mederly committed Jun 21, 2022
1 parent 1d2464e commit 86d05d5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1070,16 +1070,19 @@ private static List<ObjectReferenceType> getActorsForCase(CaseType caseType) {
if (caseType != null) {
List<CaseWorkItemType> caseWorkItemTypes = caseType.getWorkItem();
for (CaseWorkItemType caseWorkItem : caseWorkItemTypes) {
actorsList.addAll(getActorsForWorkitem(caseWorkItem, CaseTypeUtil.isClosed(caseType)));
actorsList.addAll(
getActorsForWorkitem(caseWorkItem, CaseTypeUtil.isClosed(caseType)));
}
}
actorsList.stream().forEach(a -> a.asReferenceValue().clearParent());
// Note that this makes the parent case object inconsistent. Hopefully it will be thrown away anyway.
actorsList.forEach(a -> a.asReferenceValue().clearParent());
return actorsList;
}

private static List<ObjectReferenceType> getActorsForWorkitem(CaseWorkItemType workItem, boolean isClosed) {
if (isClosed) {
return Collections.singletonList(workItem.getPerformerRef());
ObjectReferenceType performerRef = workItem.getPerformerRef();
return performerRef != null ? List.of(performerRef) : List.of();
} else if (workItem.getAssigneeRef() != null && !workItem.getAssigneeRef().isEmpty()) {
return workItem.getAssigneeRef();
} else {
Expand Down

0 comments on commit 86d05d5

Please sign in to comment.