Skip to content

Commit

Permalink
fix(aspects): fix null aspects case (datahub-project#3501)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons authored and shirshanka committed Nov 6, 2021
1 parent d79f25b commit f74c297
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public List<DataFetcherResult<Aspect>> batchLoad(@Nonnull List<VersionedAspectKe
return keys.stream().map(key -> {
try {
VersionedAspect entity = _entityClient.getAspect(key.getUrn(), key.getAspectName(), key.getVersion(), context.getActor());
if (entity == null) {
return DataFetcherResult.<Aspect>newResult().data(null).build();
}

return DataFetcherResult.<Aspect>newResult().data(AspectMapper.map(entity)).build();
} catch (RemoteInvocationException e) {
if (e instanceof RestLiResponseException) {
Expand Down

0 comments on commit f74c297

Please sign in to comment.