From 35b057f8341a1ab1bf7379425dbb5647abbbb787 Mon Sep 17 00:00:00 2001 From: hr2904 Date: Fri, 22 Mar 2024 17:05:37 +0530 Subject: [PATCH] Fixed a NPE occuring when AtlasEntity did not have any classifications. --- .../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java index 9bd372f01d..9e26f6988a 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java @@ -1569,7 +1569,10 @@ private EntityMutationContext preCreateOrUpdate(EntityStream entityStream, Entit for (Map.Entry element : referencedGuids.entrySet()) { String guid = element.getKey(); AtlasEntity entity = entityStream.getByGuid(guid); - entityRetriever.verifyClassificationsPropagationMode(entity.getClassifications()); + + if(Objects.nonNull(entity) && Objects.nonNull(entity.getClassifications())) { + entityRetriever.verifyClassificationsPropagationMode(entity.getClassifications()); + } if (entity != null) { // entity would be null if guid is not in the stream but referenced by an entity in the stream AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entity.getTypeName());