Commit b86e8591 by ashutoshm Committed by Madhan Neethiraj

ATLAS-1672: fix for issues flagged by Coverity scan

parent 94158e16
...@@ -231,8 +231,14 @@ public class AtlasEntityChangeNotifier { ...@@ -231,8 +231,14 @@ public class AtlasEntityChangeNotifier {
if (StringUtils.isEmpty(entityId) || CollectionUtils.isEmpty(classifications)) { if (StringUtils.isEmpty(entityId) || CollectionUtils.isEmpty(classifications)) {
return; return;
} }
AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(entityId); AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(entityId);
if (atlasVertex == null) {
LOG.warn("updateFullTextMapping(): no entity exists with guid {}", entityId);
return;
}
try { try {
String classificationFullText = fullTextMapperV2.getIndexTextForClassifications(entityId, classifications); String classificationFullText = fullTextMapperV2.getIndexTextForClassifications(entityId, classifications);
String existingFullText = (String) GraphHelper.getProperty(atlasVertex, Constants.ENTITY_TEXT_PROPERTY_KEY); String existingFullText = (String) GraphHelper.getProperty(atlasVertex, Constants.ENTITY_TEXT_PROPERTY_KEY);
...@@ -250,4 +256,4 @@ public class AtlasEntityChangeNotifier { ...@@ -250,4 +256,4 @@ public class AtlasEntityChangeNotifier {
doFullTextMapping(Collections.singletonList(entityHeader)); doFullTextMapping(Collections.singletonList(entityHeader));
} }
} }
\ No newline at end of file
...@@ -196,7 +196,8 @@ public class ZipSource implements EntityImportStream { ...@@ -196,7 +196,8 @@ public class ZipSource implements EntityImportStream {
private AtlasEntity getEntity(String guid) throws AtlasBaseException { private AtlasEntity getEntity(String guid) throws AtlasBaseException {
if(guidEntityJsonMap.containsKey(guid)) { if(guidEntityJsonMap.containsKey(guid)) {
return getEntityWithExtInfo(guid).getEntity(); AtlasEntityWithExtInfo extInfo = getEntityWithExtInfo(guid);
return (extInfo != null) ? extInfo.getEntity() : null;
} }
return null; return 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