]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Do not display unit warnings for clouds (fixes #4307)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 6 Jun 2013 06:15:24 +0000 (06:15 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 6 Jun 2013 06:15:24 +0000 (06:15 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27507 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/UnitFunction.java

index 3e7d30fb753f965a6466e064437159642aad224e..24e3c80c9074a8cddce41c771e6686a79efdcf65 100644 (file)
@@ -42,7 +42,7 @@ public class UnitFunction {
     @SCLValue(type = "ReadGraph -> Resource -> [Issue]")\r
     public static List<Issue> unitValidator(ReadGraph graph, Resource component) throws DatabaseException {\r
         SysdynResource SR = SysdynResource.getInstance(graph);\r
-        if(graph.isInstanceOf(component, SR.Variable))\r
+        if(graph.isInstanceOf(component, SR.Variable) && !graph.isInstanceOf(component, SR.Cloud))\r
             return variableValidator(graph, component);\r
         else if(graph.isInstanceOf(component, SR.Module))\r
             return moduleValidator(graph, component);\r
@@ -255,7 +255,7 @@ public class UnitFunction {
             \r
             for(Resource connection :  graph.getObjects(r, SR.Variable_isTailOf)) {\r
                 Resource head = graph.getPossibleObject(connection, SR.Variable_HasHead);\r
-                if(graph.isInstanceOf(head, SR.Module)) {\r
+                if(head != null && graph.isInstanceOf(head, SR.Module)) {\r
                     components.add(head);\r
                 }\r
             }\r