]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/RuntimeEnvironmentRequest2.java
Still working for multiple readers
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / RuntimeEnvironmentRequest2.java
index 4bbd480020141b5e602c9e7f73fb1b8170410995..9faf02cc8550ea8b34fcd780cafdaa60c9e47812 100644 (file)
@@ -111,9 +111,11 @@ public class RuntimeEnvironmentRequest2 extends BinaryRead<Resource, Resource, R
         fillEnvironmentSpecification(environmentSpecification);
 
         Layer0 L0 = Layer0.getInstance(graph);
-        Collection<Resource> sclModules = graph.syncRequest(new ObjectsWithType(parameter, L0.ConsistsOf, L0.SCLModule));
-        for (Resource sclModule : sclModules)
-            environmentSpecification.importModule(graph.getURI(sclModule), "");
+        if(parameter != null) {
+               Collection<Resource> sclModules = graph.syncRequest(new ObjectsWithType(parameter, L0.ConsistsOf, L0.SCLModule));
+               for (Resource sclModule : sclModules)
+                   environmentSpecification.importModule(graph.getURI(sclModule), "");
+        }
 
         Resource mainModule = Layer0Utils.getPossibleChild(graph, parameter2, "SCLMain");
         if(mainModule != null)