未验证 提交 5429b35d 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #23412 from sharwell/InternalsVisibleToCompletionProvider_NRE_Fix

Fix for #22690 NRE in GetAttributeSyntaxNodeOfToken
......@@ -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("|
......@@ -250,4 +250,4 @@ private static string GetPublicKeyAsHexString(ImmutableArray<byte> publicKey)
return pooledStrBuilder.ToStringAndFree();
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册