← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13304: NPE checks in hibernateusercredentialstore

 

------------------------------------------------------------
revno: 13304
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-18 14:03:23 +0100
message:
  NPE checks in hibernateusercredentialstore
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserCredentialsStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserCredentialsStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserCredentialsStore.java	2013-12-18 12:58:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserCredentialsStore.java	2013-12-18 13:03:23 +0000
@@ -90,7 +90,8 @@
 
         User persistedUser = userService.getUser( userCredentials.getUser().getUid() );
 
-        if ( !persistedUser.getUserCredentials().getPassword().equals( userCredentials.getPassword() ) )
+        if ( persistedUser != null && persistedUser.getUserCredentials() != null
+            && !persistedUser.getUserCredentials().getPassword().equals( userCredentials.getPassword() ) )
         {
             userCredentials.setPasswordLastUpdated( new Date() );
         }