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