This is an automated email from the ASF dual-hosted git repository.

mandarambawane pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 1fd4efdc9 ATLAS-4859 : NPE during Atlas Import
1fd4efdc9 is described below

commit 1fd4efdc90cfc333f50360c3990ea9a06e5e5cf4
Author: priyanshi-shah26 <priyanshi.s...@freestoneinfotech.com>
AuthorDate: Mon Aug 5 16:27:21 2024 +0530

    ATLAS-4859 : NPE during Atlas Import
    
    Signed-off-by: Mandar Ambawane <mandar.ambaw...@freestoneinfotech.com>
---
 .../atlas/repository/store/graph/v2/EntityGraphMapper.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
index e58f96663..6b395dd17 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
@@ -2255,8 +2255,18 @@ public class EntityGraphMapper {
     }
 
     private boolean classificationHasPendingTask(AtlasTask task, String 
classificationVertexId, String entityGuid) {
-        return 
task.getParameters().get(ClassificationTask.PARAM_CLASSIFICATION_VERTEX_ID).equals(classificationVertexId)
-                && 
task.getParameters().get(ClassificationTask.PARAM_ENTITY_GUID).equals(entityGuid);
+        if (task.getParameters() != null) {
+            if (classificationVertexId != null && entityGuid != null) {
+                return 
task.getParameters().get(ClassificationTask.PARAM_CLASSIFICATION_VERTEX_ID).equals(classificationVertexId)
+                        && 
task.getParameters().get(ClassificationTask.PARAM_ENTITY_GUID).equals(entityGuid);
+            } else {
+                LOG.warn("ClassificationVertexId and EntityGuid not found!");
+                return false;
+            }
+        } else {
+            LOG.warn("No task parameters found!");
+            return false;
+        }
     }
 
     private AtlasEntity updateClassificationText(AtlasVertex vertex) throws 
AtlasBaseException {

Reply via email to