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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ee49fd  ATLAS-3373: Regression : Creating an entity with unknown type 
throws 500 , expected is 400 bad request
5ee49fd is described below

commit 5ee49fde2a1ec31e587c2123b823e3464bbada5e
Author: Sarath Subramanian <[email protected]>
AuthorDate: Wed Aug 14 12:01:49 2019 -0700

    ATLAS-3373: Regression : Creating an entity with unknown type throws 500 , 
expected is 400 bad request
---
 .../atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
index 84bb2a3..44df351 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
@@ -402,6 +402,10 @@ public class AtlasEntityGraphDiscoveryV2 implements 
EntityGraphDiscovery {
     private void processDynamicAttributes(AtlasEntity entity) throws 
AtlasBaseException {
         AtlasEntityType entityType = 
typeRegistry.getEntityTypeByName(entity.getTypeName());
 
+        if (entityType == null) {
+            throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, 
TypeCategory.ENTITY.name(), entity.getTypeName());
+        }
+
         for (AtlasAttribute attribute : entityType.getDynEvalAttributes()) {
             String              attributeName   = attribute.getName();
             List<TemplateToken> tokens          = 
entityType.getParsedTemplates().get(attributeName);

Reply via email to