ChinmayHegde24 commented on code in PR #992:
URL: https://github.com/apache/ranger/pull/992#discussion_r3361570827


##########
security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java:
##########
@@ -1653,6 +1653,35 @@ public VXGroupUser updateXGroupUser(VXGroupUser 
vXGroupUser) {
 
         xaBizUtil.blockAuditorRoleUser();
 
+        if (vXGroupUser == null) {
+            throw 
restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, 
"Groupuser not found", true);
+        }
+
+        XXGroupUser xxGroupUser = null;

Review Comment:
   We can remove this dead variable and better to group checks in single **if** 
like below
   if (vXGroupUser.getId() != null &&
           daoManager.getXXGroupUser().getById(vXGroupUser.getId()) == null) {
       throw restErrorUtil.createRESTException(
               "Group-User mapping not found with ID: " + vXGroupUser.getId(),
               MessageEnums.DATA_NOT_FOUND);
   }



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to