Skip to content

Commit

Permalink
fix(graphql) Fix NPE on form actor assignemnt (#11203)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscollins3456 authored Aug 20, 2024
1 parent f15a7fe commit 8e35eb9
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2728,19 +2728,23 @@ private void configureFormResolvers(final RuntimeWiring.Builder builder) {
corpUserType,
(env) -> {
final FormActorAssignment actors = env.getSource();
return actors.getUsers().stream()
.map(CorpUser::getUrn)
.collect(Collectors.toList());
return actors.getUsers() != null
? actors.getUsers().stream()
.map(CorpUser::getUrn)
.collect(Collectors.toList())
: null;
}))
.dataFetcher(
"groups",
new LoadableTypeBatchResolver<>(
corpGroupType,
(env) -> {
final FormActorAssignment actors = env.getSource();
return actors.getGroups().stream()
.map(CorpGroup::getUrn)
.collect(Collectors.toList());
return actors.getGroups() != null
? actors.getGroups().stream()
.map(CorpGroup::getUrn)
.collect(Collectors.toList())
: null;
}))
.dataFetcher("isAssignedToMe", new IsFormAssignedToMeResolver(groupService)));
}
Expand Down

0 comments on commit 8e35eb9

Please # to comment.