Skip to content

Commit 9731b7d

Browse files
committed
GetStatus returns Unknown if it cant find the status
1 parent fc5de2f commit 9731b7d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

StyleCop.Analyzers.Status.Generator/SolutionReader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ private string GetStatus(INamedTypeSymbol classSymbol, SyntaxNode root, Semantic
191191

192192
VariableDeclaratorSyntax node = root.FindNode(members.Locations.FirstOrDefault().SourceSpan) as VariableDeclaratorSyntax;
193193

194+
if (node == null)
195+
{
196+
return "Unknown";
197+
}
198+
194199
ObjectCreationExpressionSyntax initializer = node.Initializer.Value as ObjectCreationExpressionSyntax;
195200

196201
// We use the fact that the only parameter that returns a boolean is the one we are interested in

0 commit comments

Comments
 (0)