Skip to content

Commit

Permalink
Do not crash if we are passed a null compilation in EnumerateSymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarolf committed May 6, 2016
1 parent 2f7f0d3 commit cab53cf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ internal NonDeclarationSymbolKey(TSymbol symbol, Visitor visitor)
private static IEnumerable<ValueTuple<TSymbol, int>> EnumerateSymbols(Compilation compilation, ISymbol containingSymbol, string name, CancellationToken cancellationToken)
{
int ordinal = 0;
if (compilation == null)
{
yield break;
}

foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
{
Expand Down

0 comments on commit cab53cf

Please sign in to comment.