Merge "check if localsession object null before closing"
authorSunder Tattavarada <statta@research.att.com>
Thu, 8 Feb 2018 17:28:25 +0000 (17:28 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 8 Feb 2018 17:28:25 +0000 (17:28 +0000)
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java

index 3535f75..c65b4af 100644 (file)
@@ -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 + "'.");