]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/scl/ReadComponentTypeInterfaceRequest.java
Fix errors with procedural user components for computational values
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / scl / ReadComponentTypeInterfaceRequest.java
index a93cbe8d4237abc857aa5bbbaa742d6c9b2b7929..6ac607e4f3730b671d2a37289eea211efe1985a5 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.structural2.scl;
 
 import gnu.trove.map.hash.THashMap;
 
+import java.util.Collections;
 import java.util.Map;
 
 import org.simantics.databoard.Bindings;
@@ -50,11 +51,16 @@ public class ReadComponentTypeInterfaceRequest extends ResourceRead<Map<String,
        @Override
        public Map<String, ComponentTypeProperty> perform(ReadGraph graph)
                        throws DatabaseException {
-               
+               if (resource == null)
+                  return Collections.emptyMap();
+
                THashMap<String, ComponentTypeProperty> result = 
                                new THashMap<String, ComponentTypeProperty>();
                
-               collect(graph, resource, result);
+               // TODO: For Antti to consider
+               // resource == null with procedural user components
+               if (resource != null)
+                   collect(graph, resource, result);
                //for(Resource t : graph.getSupertypes(resource)) collect(graph, t, result);
                
                return result;