commit | 7892a331cd665f81ee782d90638cf66ca5bf8617 | [log] [tgz] |
---|---|---|
author | Sarath Subramanian <ssubramanian@hortonworks.com> | Tue Dec 05 19:13:05 2017 -0800 |
committer | Sarath Subramanian <ssubramanian@hortonworks.com> | Tue Dec 05 19:13:05 2017 -0800 |
tree | 96f52bd98ad2a0e4f7db5f1af46810a2ce7ed7a5 | |
parent | 1c58f3aae4bef0406c2415a8fc148b3558e02cae [diff] |
ATLAS-2299: Regression : Creating an entity of unknown type throws NPE
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 @@ AtlasEntityType type = typeRegistry.getEntityTypeByName(entity.getTypeName()); + if (type == null) { + throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_TYPENAME, entity.getTypeName()); + } + recordObjectReference(entity.getGuid()); visitEntity(type, entity);