diff --git a/src/main/java/de/dhbwstuttgart/target/generate/StatementToTargetExpression.java b/src/main/java/de/dhbwstuttgart/target/generate/StatementToTargetExpression.java index c6ee9939..92f20b9d 100644 --- a/src/main/java/de/dhbwstuttgart/target/generate/StatementToTargetExpression.java +++ b/src/main/java/de/dhbwstuttgart/target/generate/StatementToTargetExpression.java @@ -1,5 +1,6 @@ package de.dhbwstuttgart.target.generate; +import de.dhbwstuttgart.exceptions.DebugException; import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; @@ -214,7 +215,7 @@ public class StatementToTargetExpression implements ASTVisitor { foundMethod = thisMethod.orElseGet(() -> findMethod(finalReceiverClass.getSuperClass().getName(), methodCall.name, signature).orElseThrow()); } else if (!isFunNType) { receiverClass = converter.compiler.getClass(receiverName); - System.out.println(receiverClass.getClassName() + " " + signature); + if (receiverClass == null) throw new DebugException("Class " + receiverName + " does not exist!"); foundMethod = findMethod(receiverName, methodCall.name, signature).orElseThrow(); }