}\r
}\r
}\r
- ArrayList<Object> declarations = (ArrayList<Object>)composition.get(0);\r
- for(Object os_ : declarations) {\r
- if(os_ instanceof VariableDeclaration) {\r
- VariableDeclaration decl = (VariableDeclaration)os_;\r
- if("input".equals(decl.direction)) function.inputs.add(decl);\r
- else if ("output".equals(decl.direction)) function.outputs.add(decl);\r
- else throw new IllegalStateException();\r
- } else {\r
- ArrayList<Object> os = (ArrayList<Object>)os_;\r
- for(Object o : os) {\r
- VariableDeclaration decl = (VariableDeclaration)o;\r
+ if(!composition.isEmpty()) {\r
+ ArrayList<Object> declarations = (ArrayList<Object>)composition.get(0);\r
+ for(Object os_ : declarations) {\r
+ if(os_ instanceof VariableDeclaration) {\r
+ VariableDeclaration decl = (VariableDeclaration)os_;\r
if("input".equals(decl.direction)) function.inputs.add(decl);\r
else if ("output".equals(decl.direction)) function.outputs.add(decl);\r
else throw new IllegalStateException();\r
+ } else {\r
+ ArrayList<Object> os = (ArrayList<Object>)os_;\r
+ for(Object o : os) {\r
+ VariableDeclaration decl = (VariableDeclaration)o;\r
+ if("input".equals(decl.direction)) function.inputs.add(decl);\r
+ else if ("output".equals(decl.direction)) function.outputs.add(decl);\r
+ else throw new IllegalStateException();\r
+ }\r
}\r
}\r
}\r