Skip to content

Commit d5e5bd7

Browse files
committed
Improved SA1101 workaround to accept missing symbol information
1 parent 40fcf00 commit d5e5bd7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1101PrefixLocalCallsWithThis.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,11 @@ private static void HandleIdentifierNameImpl(SyntaxNodeAnalysisContext context,
193193
{
194194
var memberAccessSymbol = context.SemanticModel.GetSymbolInfo(nameExpression.Parent, context.CancellationToken).Symbol;
195195

196-
switch (memberAccessSymbol.Kind)
196+
switch (memberAccessSymbol?.Kind)
197197
{
198+
case null:
199+
break;
200+
198201
case SymbolKind.Field:
199202
case SymbolKind.Method:
200203
case SymbolKind.Property:

0 commit comments

Comments
 (0)