]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java
Made SCLExpressionIssueProvider component requests synchronous
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / scl / issue / SCLExpressionIssueProvider.java
index fbba1546ffbc2a0e81a75c95bea69c6e290b9584..1d04928c840f177d76eaebc3371c780972901b96 100644 (file)
@@ -145,7 +145,11 @@ public class SCLExpressionIssueProvider implements SCLIssueProvider {
             if (!graph.hasStatement(parameter))
                 return null;
             
-            Variable componentVariable = Variables.getVariable(graph, parameter);
+            Variable componentVariable = Variables.getPossibleVariable(graph, parameter);
+            if (componentVariable == null) {
+                // Resource might be deleted already and therefore no URI available for variable building
+                return null;
+            }
             Variable propertyVariable = componentVariable.getProperty(graph, parameter2);
             
             Variable typeVariable = Variables.getVariable(graph, type);
@@ -191,7 +195,7 @@ public class SCLExpressionIssueProvider implements SCLIssueProvider {
         }
         
         @Override
-        public void execute(ReadGraph graph, Set<Resource> newComponents) {
+        public void execute(ReadGraph graph, Set<Resource> newComponents) throws DatabaseException {
             if (currentlyListening.isEmpty() && newComponents.isEmpty()) {
                 // we can stop here as nothing will change
                 return;
@@ -212,7 +216,7 @@ public class SCLExpressionIssueProvider implements SCLIssueProvider {
             for (Resource addedComponent : addedComponents) {
                 SCLValueDisposableSyncListener listener = new SCLValueDisposableSyncListener(callback);
                 currentlyListening.put(addedComponent, listener);
-                graph.asyncRequest(new SCLValueRequest(addedComponent), listener);
+                graph.syncRequest(new SCLValueRequest(addedComponent), listener);
             }
         }