commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [1/5] [math] Prevent NullPointerException.
Date Thu, 10 Dec 2015 14:15:49 GMT
Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X 10c271f2c -> 7cbc5fe00


Prevent NullPointerException.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/3dfedb1d
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/3dfedb1d
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/3dfedb1d

Branch: refs/heads/MATH_3_X
Commit: 3dfedb1db55574a751efea857285fed6a76dcdd9
Parents: 10c271f
Author: Luc Maisonobe <luc@apache.org>
Authored: Thu Dec 10 14:28:07 2015 +0100
Committer: Luc Maisonobe <luc@apache.org>
Committed: Thu Dec 10 14:28:07 2015 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math3/ode/FieldODEState.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/3dfedb1d/src/main/java/org/apache/commons/math3/ode/FieldODEState.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/ode/FieldODEState.java b/src/main/java/org/apache/commons/math3/ode/FieldODEState.java
index d18dc6a..e231337 100644
--- a/src/main/java/org/apache/commons/math3/ode/FieldODEState.java
+++ b/src/main/java/org/apache/commons/math3/ode/FieldODEState.java
@@ -113,7 +113,7 @@ public class FieldODEState<T extends RealFieldElement<T>>
{
      * @return number of secondary states.
      */
     public int getNumberOfSecondaryStates() {
-        return secondaryState.length;
+        return secondaryState == null ? 0 : secondaryState.length;
     }
 
     /** Get secondary state dimension.


Mime
View raw message