...
|
...
|
@@ -432,7 +432,8 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic |
432
|
432
|
ListenableFuture<List<EntityRelation>> originatorEdgeRelationsFuture =
|
433
|
433
|
relationService.findByToAndTypeAsync(tenantId, entityId, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE);
|
434
|
434
|
return Futures.transform(originatorEdgeRelationsFuture, originatorEdgeRelations -> {
|
435
|
|
- if (originatorEdgeRelations != null && originatorEdgeRelations.size() > 0) {
|
|
435
|
+ if (originatorEdgeRelations != null && originatorEdgeRelations.size() > 0 &&
|
|
436
|
+ originatorEdgeRelations.get(0).getFrom() != null) {
|
436
|
437
|
return Collections.singletonList(new EdgeId(originatorEdgeRelations.get(0).getFrom().getId()));
|
437
|
438
|
} else {
|
438
|
439
|
return Collections.emptyList();
|
...
|
...
|
@@ -444,6 +445,9 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic |
444
|
445
|
return convertToEdgeIds(findEdgesByTenantIdAndRuleChainId(tenantId, new RuleChainId(entityId.getId())));
|
445
|
446
|
case USER:
|
446
|
447
|
User userById = userService.findUserById(tenantId, new UserId(entityId.getId()));
|
|
448
|
+ if (userById == null) {
|
|
449
|
+ return Futures.immediateFuture(Collections.emptyList());
|
|
450
|
+ }
|
447
|
451
|
TextPageData<Edge> edges;
|
448
|
452
|
if (userById.getCustomerId() == null || userById.getCustomerId().isNullUid()) {
|
449
|
453
|
edges = findEdgesByTenantId(tenantId, new TextPageLink(Integer.MAX_VALUE));
|
...
|
...
|
|