From: Sunder Tattavarada Date: Thu, 8 Feb 2018 17:28:25 +0000 (+0000) Subject: Merge "check if localsession object null before closing" X-Git-Tag: v2.2.0~49 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=08f55be6a0a9708ceeb176d5e1a0a56f885fad59;hp=8bcc6f6d7a6b24f9358f897d5aad18f618fa0b95;p=portal.git Merge "check if localsession object null before closing" --- diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java index 3535f753..c65b4af9 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java @@ -371,7 +371,9 @@ public class UserRolesCommonServiceImpl { throw new Exception(e.getMessage()); } } finally { - localSession.close(); + if (localSession != null) { + localSession.close(); + } if (!result && !"DELETE".equals(reqType)) { throw new Exception( "Exception occurred in syncUserRoles while closing database session for app: '" + appId + "'.");