From bbe98190fe60fb4412c531fefc8f2b63ce4f9131 Mon Sep 17 00:00:00 2001 From: lempinen Date: Fri, 1 Mar 2013 11:53:18 +0000 Subject: [PATCH] Added a check so that EquationTab does not create a default expression for variable that has already been removed. (fixes #4137) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26945 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/sysdyn/ui/properties/EquationTab.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java index 363a01f6..bed25ff2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java @@ -238,6 +238,13 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { @Override public Resource perform(WriteGraph graph) throws DatabaseException { + if(!graph.hasStatement(variable)) { + /* Trying to create empty experiment for removed variable due to + * async setInput + */ + return null; + } + SysdynResource sr = SysdynResource.getInstance(graph); Layer0 l0 = Layer0.getInstance(graph); Resource expressions = ListUtils.create(graph, Collections.emptyList()); @@ -283,6 +290,9 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { } catch (DatabaseException e) { e.printStackTrace(); } + + if(expression == null) + return; } // Now the variable should have an expression -- 2.47.1