From 116a76fa69f3af99d0f334776e8028396434fdb0 Mon Sep 17 00:00:00 2001 From: miettinen Date: Mon, 10 Dec 2012 10:41:12 +0000 Subject: [PATCH] Null checks for lazy result reading save (refs #3709) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26516 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/manager/SysdynResult.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynResult.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynResult.java index 6dc7ee86..4ad2d9b8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynResult.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynResult.java @@ -169,6 +169,7 @@ public class SysdynResult { MapAccessor recordings = accessor.getFieldAccessor("recordings"); // There is a recording for each variable + if (simulationResult == null) return; List datasets = simulationResult.getVariableDataSets(); RecordBinding recordingBinding = (RecordBinding) Bindings.getBinding( Recording.class ); @@ -308,7 +309,9 @@ public class SysdynResult { } catch (AccessorConstructionException e) { // Variable was not found, so read it from file try { - simulationResult.readVariable(variable, resultFile); + if (simulationResult != null) { + simulationResult.readVariable(variable, resultFile); + } } catch (FileNotFoundException e1) { // Unable to read data from OpenModelica result file System.err.println("Variable " + variable + " not found in OpenModelica result file"); -- 2.47.1