summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-core/src
diff options
context:
space:
mode:
authorParshad Patel <pars.patel@samsung.com>2019-12-10 17:05:21 +0900
committerParshad Patel <pars.patel@samsung.com>2020-01-23 16:57:50 +0900
commita231d482351c64dc35563821d9531981ba28d4f3 (patch)
tree66fded7d469f82b3ed57dfc3b7fd307d6fe6934a /ecomp-sdk/epsdk-core/src
parent28af72fc23a1e0cb67e1ac1b5fac6b6d9020270a (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')
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java4
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);