Skip to content

Commit

Permalink
Fix NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Oct 7, 2020
1 parent a62bb03 commit b5732e9
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,8 @@ private static bool IsPrimaryConstructorParameter(SyntaxToken token, SemanticMod
_ => s_propertySyntaxKind,
cancellationToken);

if (!token.GetAncestor<ParameterSyntax>().Parent.IsParentKind(SyntaxKind.RecordDeclaration))
{
return false;
}

return result.Type != null;
return result.Type != null &&
token.GetAncestor<ParameterSyntax>().Parent.IsParentKind(SyntaxKind.RecordDeclaration);
}

private static bool IsParameterDeclaration(SyntaxToken token, SemanticModel semanticModel,
Expand Down

0 comments on commit b5732e9

Please sign in to comment.