Skip to content

Commit

Permalink
fix(graphql) Fix null pointer exception when fetching entity aspects …
Browse files Browse the repository at this point in the history
…via graphql (#5857)
  • Loading branch information
chriscollins3456 authored Sep 7, 2022
1 parent 42a847c commit 494f38e
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ public CompletableFuture<List<RawAspect>> get(DataFetchingEnvironment environmen

DataMap renderSpec = aspectSpec.getRenderSpec();

AspectRenderSpec resultRenderSpec = new AspectRenderSpec();

resultRenderSpec.setDisplayType(renderSpec.getString("displayType"));
resultRenderSpec.setDisplayName(renderSpec.getString("displayName"));
resultRenderSpec.setKey(renderSpec.getString("key"));
result.setRenderSpec(resultRenderSpec);
if (renderSpec != null) {
AspectRenderSpec resultRenderSpec = new AspectRenderSpec();
resultRenderSpec.setDisplayType(renderSpec.getString("displayType"));
resultRenderSpec.setDisplayName(renderSpec.getString("displayName"));
resultRenderSpec.setKey(renderSpec.getString("key"));
result.setRenderSpec(resultRenderSpec);
}

results.add(result);
} catch (IOException | RemoteInvocationException | URISyntaxException e) {
Expand Down

0 comments on commit 494f38e

Please sign in to comment.