← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9054: NPE bugfix with date parsing in currentusercontroller

 

------------------------------------------------------------
revno: 9054
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-15 15:46:52 +0100
message:
  NPE bugfix with date parsing in currentusercontroller
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java
  dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache


--
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-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java	2012-11-13 13:15:01 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java	2012-11-15 14:46:52 +0000
@@ -172,7 +172,12 @@
         userAccount.setIntroduction( currentUser.getIntroduction() );
         userAccount.setJobTitle( currentUser.getJobTitle() );
         userAccount.setGender( currentUser.getGender() );
-        userAccount.setBirthday( simpleDateFormat.format( currentUser.getBirthday() ) );
+
+        if ( currentUser.getBirthday() != null )
+        {
+            userAccount.setBirthday( simpleDateFormat.format( currentUser.getBirthday() ) );
+        }
+
         userAccount.setNationality( currentUser.getNationality() );
         userAccount.setEmployer( currentUser.getEmployer() );
         userAccount.setEducation( currentUser.getEducation() );
@@ -204,7 +209,12 @@
         currentUser.setIntroduction( userAccount.getIntroduction() );
         currentUser.setJobTitle( userAccount.getJobTitle() );
         currentUser.setGender( userAccount.getGender() );
-        currentUser.setBirthday( simpleDateFormat.parse( userAccount.getBirthday() ) );
+
+        if ( userAccount.getBirthday() != null )
+        {
+            currentUser.setBirthday( simpleDateFormat.parse( userAccount.getBirthday() ) );
+        }
+
         currentUser.setNationality( userAccount.getNationality() );
         currentUser.setEmployer( userAccount.getEmployer() );
         currentUser.setEducation( userAccount.getEducation() );

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache	2012-11-15 14:35:19 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache	2012-11-15 14:46:52 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# Version: 2.11-SNAPSHOT V1
+# Version: 2.11-SNAPSHOT V2
 
 CACHE:
 ../mobile/index