Skip to content
Snippets Groups Projects
Commit f57bb1b5 authored by Peter Alexander's avatar Peter Alexander
Browse files

Fix NPE in YieldResponse

parent b2e53a3f
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,6 @@ public class YieldResponse {
if (Double.isNaN(asymptoteYieldIncI) || Double.isNaN(fertParm)) {
LogWriter.println("Not finding a suitable extrapolating solution. Defaulting to old style");
fertParm = calcParam(yMinNoI, yMidNoI, yMaxNoI, fMid);
yieldsExtrapolated = yields;
}
else {
yieldsExtrapolated = new HashMap<YieldType, Double>();
......@@ -86,8 +84,11 @@ public class YieldResponse {
yieldsExtrapolated.put(YieldType.FERT_MAX_IRRIG_MAX, asymptoteYieldIncI+yMinI);
}
}
else {
// old style, if not wanting extrapolate or data doesn't allow
if (yieldsExtrapolated == null) {
fertParm = calcParam(yMinNoI, yMidNoI, yMaxNoI, fMid);
yieldsExtrapolated = yields;
}
return fertParm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment