diff options
author | 2019-12-10 17:05:21 +0900 | |
---|---|---|
committer | 2020-01-23 16:57:50 +0900 | |
commit | a231d482351c64dc35563821d9531981ba28d4f3 (patch) | |
tree | 66fded7d469f82b3ed57dfc3b7fd307d6fe6934a /ecomp-sdk/epsdk-core/src/main | |
parent | 28af72fc23a1e0cb67e1ac1b5fac6b6d9020270a (diff) |
Fix NullPointerException & other sonar issues
A "NullPointerException" could be thrown
Use a logger to log this exception
Cast one of the operands of this multiplication operation to a "long"
Use isEmpty() to check whether the collection is empty or not
Issue-ID: PORTAL-562
Change-Id: I1bc657a8893379329547b131b53e37da873d55db
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/main')
-rw-r--r-- | ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java index 09fb374a..95ca3de7 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java @@ -127,7 +127,9 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS if (appuser == null && userHasRoleFunctions(user)) { createUserIfNecessary(user); } else { - appuser.setLastLoginDate(new Date()); + if(appuser != null) { + appuser.setLastLoginDate(new Date()); + } // update the last logged in date for the user dataAccessService.saveDomainObject(appuser, additionalParams); |