Skip to content

Commit

Permalink
Merge pull request #3530 from atlanhq/hr-audit-listener-npe-fix-ssb-beta
Browse files Browse the repository at this point in the history
Audit listener npe fix for SSB
  • Loading branch information
hr2904 committed Sep 19, 2024
2 parents 7d88f83 + 228befe commit f958cab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,13 @@ private void getClassificationTextFromEntity(List<AtlasClassification> classific
}

for (AtlasClassification classification : classifications) {
if(Objects.isNull(entity) ||
Objects.isNull(classification) ||
Objects.isNull(entity.getGuid()) ||
Objects.isNull(classification.getEntityGuid())) {
LOG.info("Probable NPE prevented : Entity {}, classification : {}, entity : {}, entity.Guid : {}, classification.getEntityGuid : {}");
continue;
}
if (entity.getGuid().equals(classification.getEntityGuid())) {
entityClassifications.computeIfAbsent(entity, key -> new ArrayList<>()).add(getDeleteClassificationMap(classification.getTypeName()));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@

import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;

@Singleton
@Component
Expand Down Expand Up @@ -332,7 +327,7 @@ public AtlasEntity getEntity(String guid, boolean ignoreRelationshipAttributes)
} else {
entity = entityGraphRetriever.toAtlasEntity(guid);
}
return entity;
return Objects.isNull(entity)?new AtlasEntity() : entity;
}


Expand Down

0 comments on commit f958cab

Please sign in to comment.