提交 77152e59 编写于 作者: T Tanner Gooding

Merge pull request #5223 from CyrusNajmabadi/useAutoPropCrash

Fix crash in 'use auto prop'.
......@@ -81,7 +81,7 @@ private bool CheckExpressionSyntactically(ExpressionSyntax expression)
protected override ExpressionSyntax GetGetterExpression(IMethodSymbol getMethod, CancellationToken cancellationToken)
{
var getAccessor = getMethod.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken) as AccessorDeclarationSyntax;
var firstStatement = getAccessor?.Body.Statements.SingleOrDefault();
var firstStatement = getAccessor?.Body?.Statements.SingleOrDefault();
if (firstStatement?.Kind() == SyntaxKind.ReturnStatement)
{
var expr = ((ReturnStatementSyntax)firstStatement).Expression;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册