diff options
author | Arindam Mondal <arind.mondal@samsung.com> | 2019-07-23 19:12:40 +0900 |
---|---|---|
committer | arind.mondal <arind.mondal@samsung.com> | 2019-07-23 19:13:06 +0900 |
commit | 0ab9cac55ff9d8b8854bf2bc58c4d17e323353e4 (patch) | |
tree | 2ffda2bb8235b7834d7a5a4d82728b48ce7b62e0 /ecomp-portal-BE-common/src/main/java | |
parent | 9eaffe830b33e6405797596d991c7f49fe615a9b (diff) |
Fix null pointer exception
+) Fix NPE
++) implement equals instead of ==
Issue-ID: PORTAL-680
Change-Id: I3a0df60b6171b114afc841b40838f6a4484370ee
Signed-off-by: arind.mondal <arind.mondal@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java')
-rw-r--r-- | ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java index b50d1cf4..9a525b51 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java @@ -523,7 +523,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getCentralAuth() && roleFunc!=null) { String code = roleFunc.getType() + PIPE + roleFunc.getCode() + PIPE + roleFunc.getAction(); CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(code, requestedApp.getUebKey()); @@ -679,7 +679,7 @@ public class RoleManageController extends EPRestrictedBaseController { } @RequestMapping(value = { "/portalApi/centralizedApps" }, method = RequestMethod.GET) - public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) throws IOException { + public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) { if(userId!=null) { SecureString secureString = new SecureString(userId); @@ -817,7 +817,7 @@ public class RoleManageController extends EPRestrictedBaseController { private boolean isAuthorizedUser(EPUser user, EPApp requestedApp) { if (user != null && (adminRolesService.isAccountAdminOfApplication(user, requestedApp) - || (adminRolesService.isSuperAdmin(user) && requestedApp.getId() == PortalConstants.PORTAL_APP_ID))) + || (adminRolesService.isSuperAdmin(user) && requestedApp.getId().equals(PortalConstants.PORTAL_APP_ID)))) return true; return false; } |