ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-79:Checks for null to avoid NPE
Date Wed, 24 Sep 2014 01:39:37 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 105e71e94 -> 1d6351a67


ARGUS-79:Checks for null to avoid NPE

Signed-off-by: sneethiraj <sneethir@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/1d6351a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/1d6351a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/1d6351a6

Branch: refs/heads/master
Commit: 1d6351a6753920ef1d9abaef20ef64228037d890
Parents: 105e71e
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Tue Sep 23 18:44:48 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Tue Sep 23 21:39:15 2014 -0400

----------------------------------------------------------------------
 .../src/main/java/com/xasecure/biz/AssetMgr.java        | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/1d6351a6/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
index 7cc6edd..6c8a4c8 100644
--- a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
+++ b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
@@ -1922,15 +1922,19 @@ public class AssetMgr extends AssetMgrBase {
 									.get("groups");
 							XXGroup xGroup = xADaoManager.getXXGroup()
 									.getById(groupId);
-							groups.add(xGroup.getName());
-							sortedPermMap.put("groups", groups);
+							if(xGroup!=null && groups != null){
+								groups.add(xGroup.getName());
+								sortedPermMap.put("groups", groups);
+							}
 						} else if (userId != null) {
 							Set<String> users = (Set<String>) sortedPermMap
 									.get("users");
 							XXUser xUser = xADaoManager.getXXUser().getById(
 									userId);
-							users.add(xUser.getName());
-							sortedPermMap.put("users", users);
+							if (users != null && xUser != null) {
+								users.add(xUser.getName());
+								sortedPermMap.put("users", users);								
+							}
 						}
 
 						Set<String> access = (Set<String>) sortedPermMap


Mime
View raw message