fix(aspects): fix null aspects case (#3501)

This commit is contained in:
Gabe Lyons 2021-11-02 17:33:52 -07:00 committed by GitHub
parent c4c74a3f45
commit 2c587ea285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,10 @@ public class AspectType {
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) {