diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java index 08f0df8d..7cc3c54b 100644 --- a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java +++ b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java @@ -180,7 +180,13 @@ public class FieldDeclaration extends Field{ //Die Felddekleration an den Konstruktor anhängen: InstructionList il = new InstructionList(); il.append(new This(this).genByteCode(cg, rs)); - il.append(this.wert.genByteCode(cg, rs)); + + if(wert != null){ + il.append(this.wert.genByteCode(cg, rs)); + }else{ + //todo: default wert? + } + FieldInstruction putFieldInstruction = cg.getInstructionFactory().createFieldAccess(this.getParentClass().getName().toString(), this.getDescription(cg, rs), this.getType().getBytecodeType(cg, rs), Constants.PUTFIELD);