Repository: incubator-ranger Updated Branches: refs/heads/master 4db23568c -> 427ed4a2b
RANGER-726: Fixed a potential NPE Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/427ed4a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/427ed4a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/427ed4a2 Branch: refs/heads/master Commit: 427ed4a2b84139c8137becb4d06cdacbf890740d Parents: 4db2356 Author: Abhay Kulkarni <[email protected]> Authored: Thu Nov 12 13:36:58 2015 -0800 Committer: Madhan Neethiraj <[email protected]> Committed: Fri Nov 13 08:30:08 2015 -0800 ---------------------------------------------------------------------- .../ranger/tagsync/source/atlas/AtlasNotificationMapper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/427ed4a2/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java ---------------------------------------------------------------------- diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java index 15a511d..7a2422b 100644 --- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java +++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java @@ -298,7 +298,7 @@ class AtlasNotificationMapper { return ret; } - static private String[] getQualifiedNameComponents(IReferenceableInstance entity) { + static private String[] getQualifiedNameComponents(IReferenceableInstance entity) throws Exception { String ret[] = new String[MAX_HIERARCHY_LEVELS]; String qualifiedNameAttributeName = StringUtils.equals(entity.getTypeName(), ENTITY_TYPE_HIVE_TABLE) ? @@ -306,6 +306,10 @@ class AtlasNotificationMapper { String qualifiedName = getEntityAttribute(entity, qualifiedNameAttributeName, String.class); + if (StringUtils.isBlank(qualifiedName)) { + throw new Exception("Could not get a valid value for " + qualifiedNameAttributeName + " attribute from entity notification."); + } + String nameHierarchy[] = qualifiedName.split(QUALIFIED_NAME_FORMAT_DELIMITER_STRING); int hierarchyLevels = nameHierarchy.length;
