Commit b688f80e by Sarath Subramanian Committed by Madhan Neethiraj

ATLAS-1322: fix dereference null return value

parent 86740c14
...@@ -320,6 +320,7 @@ public final class RestUtils { ...@@ -320,6 +320,7 @@ public final class RestUtils {
if (isForeignKey) { if (isForeignKey) {
AtlasType attribType = entityType.getAttributeType(attrDef.getName()); AtlasType attribType = entityType.getAttributeType(attrDef.getName());
if (attribType != null) {
if (attribType.getTypeCategory() == TypeCategory.ARRAY) { if (attribType.getTypeCategory() == TypeCategory.ARRAY) {
attribType = ((AtlasArrayType) attribType).getElementType(); attribType = ((AtlasArrayType) attribType).getElementType();
} }
...@@ -328,12 +329,13 @@ public final class RestUtils { ...@@ -328,12 +329,13 @@ public final class RestUtils {
String revAttrName = ((AtlasEntityType) attribType). String revAttrName = ((AtlasEntityType) attribType).
getMappedFromRefAttribute(entityType.getTypeName(), attrDef.getName()); getMappedFromRefAttribute(entityType.getTypeName(), attrDef.getName());
if (StringUtils.equals(classTypeDefName , attrDef.getTypeName()) && if (StringUtils.equals(classTypeDefName, attrDef.getTypeName()) &&
StringUtils.equals(oldAttr.name, revAttrName)) { StringUtils.equals(oldAttr.name, revAttrName)) {
refAttrName = attrDef.getName(); refAttrName = attrDef.getName();
} }
} }
} }
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment