Skip to content
Snippets Groups Projects
Commit fda5fce7 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Bugfix: Now tolerating NULL collections of weather data

parent c3b7c74c
No related branches found
No related tags found
No related merge requests found
......@@ -520,7 +520,9 @@ public class WeatherUtil {
// If all parameters are complete, we can use Nærstad's algorithm. Otherwise, if we only have UM,
// we must resort to Trapman's algorithm
List<WeatherObservation> calculatedBT;
if(TM.size() == RR.size() && TM.size() == Q0.size() && TM.size() == FM2.size() && TM.size() == UM.size())
if( TM != null && RR != null && Q0 != null && FM2 != null && UM != null
&& TM.size() == RR.size() && TM.size() == Q0.size() && TM.size() == FM2.size() && TM.size() == UM.size()
)
{
// The algorithm uses the first hour of input values as "startup"
// So if we have some leaf wetness, we can provide the first hour.
......@@ -552,7 +554,9 @@ public class WeatherUtil {
calculatedBT.addAll(this.calculateLeafWetnessHourSeriesNaerstad(TM, RR, Q0, FM2, UM, null));
}
}
else if(TM.size() == RR.size() && TM.size() == UM.size())
else if( TM != null && RR != null && UM != null
&& TM.size() == RR.size() && TM.size() == UM.size()
)
{
/*
System.out.println("Trapman BT: startTime=" + startTime);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment