Skip to content

Commit 042adac

Browse files
committed
Update WurstValidator.java
1 parent d66dff1 commit 042adac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/validation/WurstValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private void visit(StmtExitwhen exitwhen) {
624624

625625
private void visit(StmtContinue stmtContinue) {
626626
Element parent = stmtContinue.getParent();
627-
while (!(parent instanceof FunctionDefinition)) {
627+
while (parent != null && !(parent instanceof FunctionDefinition)) {
628628
if (parent instanceof StmtForEach) {
629629
StmtForEach forEach = (StmtForEach) parent;
630630
if (forEach.getIn().tryGetNameDef().attrIsVararg()) {
@@ -636,7 +636,7 @@ private void visit(StmtContinue stmtContinue) {
636636
}
637637
parent = parent.getParent();
638638
}
639-
stmtContinue.addError("Continue is not allowed outside of loop statements.");
639+
stmtContinue.addError("Continue statements must be used inside a loop.");
640640
}
641641

642642
private void checkTupleDef(TupleDef e) {

0 commit comments

Comments
 (0)