← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13881: minor NPE check, snapshot value can in certain cases be equal to null

 

------------------------------------------------------------
revno: 13881
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-28 18:45:19 +0700
message:
  minor NPE check, snapshot value can in certain cases be equal to null
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.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/hibernate/HibernateEventListenerWiring.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java	2014-01-28 04:23:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java	2014-01-28 11:45:19 +0000
@@ -115,11 +115,14 @@
 
             Map<?, ?> map = (Map<?, ?>) oldValue;
 
-            for ( Object o : map.keySet() )
+            if ( oldValue != null )
             {
-                if ( o instanceof IdentifiableObject )
+                for ( Object o : map.keySet() )
                 {
-                    oldCol.add( o );
+                    if ( o instanceof IdentifiableObject )
+                    {
+                        oldCol.add( o );
+                    }
                 }
             }