You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2018/01/18 13:30:37 UTC

atlas git commit: ATLAS-2376: Fix for unitTest case in ExportServiceTest due to NPE

Repository: atlas
Updated Branches:
  refs/heads/master bd87c3f62 -> 39be2ccfd


ATLAS-2376: Fix for unitTest case in ExportServiceTest due to NPE


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/39be2ccf
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/39be2ccf
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/39be2ccf

Branch: refs/heads/master
Commit: 39be2ccfdf5ec3edb59d7779e7b3f7d95413b632
Parents: bd87c3f
Author: nixonrodrigues <ni...@apache.org>
Authored: Thu Jan 18 18:40:55 2018 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Thu Jan 18 18:40:55 2018 +0530

----------------------------------------------------------------------
 .../apache/atlas/repository/impexp/ExportService.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/39be2ccf/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
index 74d9180..c5e6534 100644
--- a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
+++ b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
@@ -457,10 +457,14 @@ public class ExportService {
     }
 
     private void removeRelationshipAttributes(AtlasEntityWithExtInfo entity) {
-        entity.getEntity().getRelationshipAttributes().clear();
-        if(entity.getReferredEntities() != null) {
-            for (AtlasEntity e: entity.getReferredEntities().values()) {
-                e.getRelationshipAttributes().clear();
+        if (entity.getEntity().getRelationshipAttributes() != null) {
+            entity.getEntity().getRelationshipAttributes().clear();
+        }
+        if (entity.getReferredEntities() != null) {
+            for (AtlasEntity e : entity.getReferredEntities().values()) {
+                if (e.getRelationshipAttributes() != null) {
+                    e.getRelationshipAttributes().clear();
+                }
             }
         }
     }