Commit c1f4007a by Madhan Neethiraj

ATLAS-2141: edit/disassociate tag results in NPE

(cherry picked from commit 4b9d2670709df52e0d983587832fe6256220691b)
parent ccd121e7
......@@ -1079,8 +1079,12 @@ public final class GraphHelper {
}
public static boolean isInternalType(AtlasVertex vertex) {
return vertex != null && isInternalType(getTypeName(vertex));
}
public static boolean isInternalType(String typeName) {
return typeName.startsWith(Constants.INTERNAL_PROPERTY_KEY_PREFIX);
return typeName != null && typeName.startsWith(Constants.INTERNAL_PROPERTY_KEY_PREFIX);
}
public static void setArrayElementsProperty(IDataType elementType, AtlasVertex instanceVertex, String propertyName, List<Object> values) {
......
......@@ -227,14 +227,10 @@ public class AtlasEntityChangeNotifier {
}
for (AtlasEntityHeader atlasEntityHeader : atlasEntityHeaders) {
if(GraphHelper.isInternalType(atlasEntityHeader.getTypeName())) {
continue;
}
String guid = atlasEntityHeader.getGuid();
AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(guid);
if(atlasVertex == null) {
if(atlasVertex == null || GraphHelper.isInternalType(atlasVertex)) {
continue;
}
......@@ -262,12 +258,7 @@ public class AtlasEntityChangeNotifier {
}
AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(entityId);
if(atlasVertex == null) {
return;
}
if (atlasVertex == null) {
LOG.warn("updateFullTextMapping(): no entity exists with guid {}", entityId);
if(atlasVertex == null || GraphHelper.isInternalType(atlasVertex)) {
return;
}
......
......@@ -187,7 +187,9 @@ public class NotificationEntityChangeListener implements EntityChangeListener {
messages.add(notification);
}
notificationInterface.send(NotificationInterface.NotificationType.ENTITIES, messages);
if (!messages.isEmpty()) {
notificationInterface.send(NotificationInterface.NotificationType.ENTITIES, messages);
}
}
private List<String> getNotificationAttributes(String entityType) {
......
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