Merge pull request #254 from WalterWaldron/fix242fix

unused_label: Fix crash on empty label statement
This commit is contained in:
Brian Schott 2015-05-12 10:10:20 -07:00
commit fd4b4edda9
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);