Repository: incubator-atlas Updated Branches: refs/heads/0.8-incubating 6f8ecd6f6 -> 5055da6df
ATLAS-1672: fix for issues flagged by Coverity scan Signed-off-by: Madhan Neethiraj <[email protected]> (cherry picked from commit b86e8591a96740d638f548e52fd18fdad34da781) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/5055da6d Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/5055da6d Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/5055da6d Branch: refs/heads/0.8-incubating Commit: 5055da6dfcb0fcc92f276b4848069dd8e10954db Parents: 6f8ecd6 Author: ashutoshm <[email protected]> Authored: Sun Mar 19 10:52:58 2017 -0700 Committer: Madhan Neethiraj <[email protected]> Committed: Mon Mar 20 09:59:06 2017 -0700 ---------------------------------------------------------------------- .../repository/store/graph/v1/AtlasEntityChangeNotifier.java | 8 +++++++- .../main/java/org/apache/atlas/web/resources/ZipSource.java | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5055da6d/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java index 8719cd4..8dd3556 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java @@ -231,8 +231,14 @@ public class AtlasEntityChangeNotifier { if (StringUtils.isEmpty(entityId) || CollectionUtils.isEmpty(classifications)) { return; } + AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(entityId); + if (atlasVertex == null) { + LOG.warn("updateFullTextMapping(): no entity exists with guid {}", entityId); + return; + } + try { String classificationFullText = fullTextMapperV2.getIndexTextForClassifications(entityId, classifications); String existingFullText = (String) GraphHelper.getProperty(atlasVertex, Constants.ENTITY_TEXT_PROPERTY_KEY); @@ -250,4 +256,4 @@ public class AtlasEntityChangeNotifier { doFullTextMapping(Collections.singletonList(entityHeader)); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5055da6d/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java ---------------------------------------------------------------------- diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java b/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java index 661542f..8b2b9df 100644 --- a/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java +++ b/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java @@ -196,7 +196,8 @@ public class ZipSource implements EntityImportStream { private AtlasEntity getEntity(String guid) throws AtlasBaseException { if(guidEntityJsonMap.containsKey(guid)) { - return getEntityWithExtInfo(guid).getEntity(); + AtlasEntityWithExtInfo extInfo = getEntityWithExtInfo(guid); + return (extInfo != null) ? extInfo.getEntity() : null; } return null;
