unused_label: Fix crash on empty label statement

This commit is contained in:
WalterW 2015-05-12 09:04:58 -04:00
parent 1945b4bee9
commit 38b6deaa25
1 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,8 @@ class UnusedLabelCheck : BaseAnalyzer
label.line = token.line;
label.column = token.column;
}
labeledStatement.declarationOrStatement.accept(this);
if (labeledStatement.declarationOrStatement !is null)
labeledStatement.declarationOrStatement.accept(this);
}
void labelUsed(string name)
@ -165,6 +166,7 @@ unittest
}();
F: // [warn]: Label "F" is not used.
return x;
G: // [warn]: Label "G" is not used.
}
}c, sac);