提交 4a5f6f53 编写于 作者: C Cyrus Najmabadi

Fix crash in 'use auto prop'.

上级 162e6178
......@@ -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.
先完成此消息的编辑!
想要评论请 注册