You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2017/12/06 03:13:25 UTC

atlas git commit: ATLAS-2299: Regression : Creating an entity of unknown type throws NPE

Repository: atlas
Updated Branches:
  refs/heads/master 1c58f3aae -> 7892a331c


ATLAS-2299: Regression : Creating an entity of unknown type throws NPE


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

Branch: refs/heads/master
Commit: 7892a331cd665f81ee782d90638cf66ca5bf8617
Parents: 1c58f3a
Author: Sarath Subramanian <ss...@hortonworks.com>
Authored: Tue Dec 5 19:13:05 2017 -0800
Committer: Sarath Subramanian <ss...@hortonworks.com>
Committed: Tue Dec 5 19:13:05 2017 -0800

----------------------------------------------------------------------
 .../repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/7892a331/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java
index 739d610..1fc1a06 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java
@@ -345,6 +345,10 @@ public class AtlasEntityGraphDiscoveryV1 implements EntityGraphDiscovery {
 
         AtlasEntityType type = typeRegistry.getEntityTypeByName(entity.getTypeName());
 
+        if (type == null) {
+            throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_TYPENAME, entity.getTypeName());
+        }
+
         recordObjectReference(entity.getGuid());
 
         visitEntity(type, entity);