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

Bugfix: Handling models without field observations

parent 8f1ea3f0
Branches
Tags
No related merge requests found
......@@ -320,11 +320,14 @@ public class ModelResourceImpl implements ModelResource{
{
config.setConfigParameter("observations", dt.getVIPSWeatherData(config.getWeatherData()));
}
config.setConfigParameter("pestObservations", dt.getVIPSPestObservations(
(List) config.getConfigParameter("fieldObservations"),
(List) config.getConfigParameter("fieldObservationQuantifications")
)
);
if(config.getConfigParameter("fieldObservations") != null)
{
config.setConfigParameter("pestObservations", dt.getVIPSPestObservations(
(List) config.getConfigParameter("fieldObservations"),
(List) config.getConfigParameter("fieldObservationQuantifications")
)
);
}
Model calledModel = ModelFactory.getInstance().getModelInstance(modelId);
calledModel.setConfiguration(config);
List<Result> results = calledModel.getResult();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment