dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41237
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20999: minor NPE check
------------------------------------------------------------
revno: 20999
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-11-10 09:25:28 +0700
message:
minor NPE check
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Order.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/query/Order.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Order.java 2015-11-09 07:46:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Order.java 2015-11-10 02:25:28 +0000
@@ -78,6 +78,11 @@
Object o1 = ReflectionUtils.invokeMethod( lside, property.getGetterMethod() );
Object o2 = ReflectionUtils.invokeMethod( rside, property.getGetterMethod() );
+ if ( o1 == null || o2 == null )
+ {
+ return 0;
+ }
+
if ( String.class.isInstance( o1 ) && String.class.isInstance( o2 ) )
{
return ascending ? ((String) o1).compareTo( (String) o2 ) : ((String) o2).compareTo( (String) o1 );