Skip to content

Commit

Permalink
Merge pull request #23412 from sharwell/InternalsVisibleToCompletionP…
Browse files Browse the repository at this point in the history
…rovider_NRE_Fix

Fix for #22690 NRE in GetAttributeSyntaxNodeOfToken
  • Loading branch information
sharwell authored Nov 29, 2017
2 parents 925ac9b + 95e9efd commit 5429b35
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static SyntaxNode GetAttributeSyntaxNodeOfToken(ISyntaxFactsService synt
//[Attribute(""|
//[Attribute("Text"|)
var node = token.Parent;
if (syntaxFactsService.IsStringLiteralExpression(node))
if (node != null && syntaxFactsService.IsStringLiteralExpression(node))
{
// Edge case: ElementAccessExpressionSyntax is present if the following statement is another attribute:
// [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("|
Expand Down Expand Up @@ -250,4 +250,4 @@ private static string GetPublicKeyAsHexString(ImmutableArray<byte> publicKey)
return pooledStrBuilder.ToStringAndFree();
}
}
}
}

0 comments on commit 5429b35

Please sign in to comment.