From: villberg Date: Tue, 26 Aug 2014 04:53:28 +0000 (+0000) Subject: refs #5224 X-Git-Tag: v1.29.0~211 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=ce1fbdac2ca6fd078e554d0226c72fb9a355f9bd;p=simantics%2Fsysdyn.git refs #5224 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30132 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java index e2c722d7..f9a17730 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java @@ -382,20 +382,22 @@ public class Parser { } } } - ArrayList declarations = (ArrayList)composition.get(0); - for(Object os_ : declarations) { - if(os_ instanceof VariableDeclaration) { - VariableDeclaration decl = (VariableDeclaration)os_; - if("input".equals(decl.direction)) function.inputs.add(decl); - else if ("output".equals(decl.direction)) function.outputs.add(decl); - else throw new IllegalStateException(); - } else { - ArrayList os = (ArrayList)os_; - for(Object o : os) { - VariableDeclaration decl = (VariableDeclaration)o; + if(!composition.isEmpty()) { + ArrayList declarations = (ArrayList)composition.get(0); + for(Object os_ : declarations) { + if(os_ instanceof VariableDeclaration) { + VariableDeclaration decl = (VariableDeclaration)os_; if("input".equals(decl.direction)) function.inputs.add(decl); else if ("output".equals(decl.direction)) function.outputs.add(decl); else throw new IllegalStateException(); + } else { + ArrayList os = (ArrayList)os_; + for(Object o : os) { + VariableDeclaration decl = (VariableDeclaration)o; + if("input".equals(decl.direction)) function.inputs.add(decl); + else if ("output".equals(decl.direction)) function.outputs.add(decl); + else throw new IllegalStateException(); + } } } }