commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [06/50] [abbrv] [math] Prevent null pointer exception at integration start.
Date Wed, 09 Dec 2015 16:16:46 GMT
Prevent null pointer exception at integration start.


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

Branch: refs/heads/MATH_3_X
Commit: e6c84480c11877073bb77a74e857fcf427409155
Parents: d724f4e
Author: Luc Maisonobe <luc@apache.org>
Authored: Sun Nov 29 20:20:18 2015 +0100
Committer: Luc Maisonobe <luc@apache.org>
Committed: Sun Nov 29 20:20:18 2015 +0100

----------------------------------------------------------------------
 .../math3/ode/sampling/AbstractFieldStepInterpolator.java        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/e6c84480/src/main/java/org/apache/commons/math3/ode/sampling/AbstractFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/ode/sampling/AbstractFieldStepInterpolator.java
b/src/main/java/org/apache/commons/math3/ode/sampling/AbstractFieldStepInterpolator.java
index bb3d722..6692222 100644
--- a/src/main/java/org/apache/commons/math3/ode/sampling/AbstractFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math3/ode/sampling/AbstractFieldStepInterpolator.java
@@ -160,7 +160,9 @@ public abstract class AbstractFieldStepInterpolator<T extends RealFieldElement<T
 
         globalCurrentState = state;
         softCurrentState   = globalCurrentState;
-        h                  = globalCurrentState.getTime().subtract(globalPreviousState.getTime());
+        if (globalPreviousState != null) {
+            h = globalCurrentState.getTime().subtract(globalPreviousState.getTime());
+        }
 
         // the step is not finalized anymore
         finalized  = false;


Mime
View raw message