You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I observed NullReferenceException while using SA1500 FixAll provider.
It happened in StyleCop.Analyzers.Helpers.LocationHelpers.GetLineSpan(this SyntaxToken token) while SyntaxToken was None (I guess default value) so the 'token.SyntaxTree' was null.
In method SA1500CodeFixProvider.GenerateBraceFixes the state was:
'braceToken' = CloseBraceToken
'previousToken' = CloseBraceToken
'nextToken' = None
then there follows call 'LocationHelpers.GetLineSpan(nextToken)'.
Stack is here:
at StyleCop.Analyzers.Helpers.LocationHelpers.GetLineSpan(SyntaxToken token)
at StyleCop.Analyzers.LayoutRules.SA1500CodeFixProvider.GenerateBraceFixes(Document document, IndentationSettings indentationSettings, ImmutableArray`1 braceTokens)
at StyleCop.Analyzers.LayoutRules.SA1500CodeFixProvider.FixAll.<FixAllInDocumentAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at StyleCop.Analyzers.Helpers.DocumentBasedFixAllProvider.<GetSolutionFixesAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.CodeAnalysis.CodeActions.CodeAction.<ComputeOperationsAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.CodeAnalysis.CodeActions.CodeAction.<GetOperationsCoreAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.CodeAnalysis.CodeActions.CodeAction.<GetOperationsAsync>d__9.MoveNext()
The text was updated successfully, but these errors were encountered:
Hi, I observed NullReferenceException while using SA1500 FixAll provider.
It happened in StyleCop.Analyzers.Helpers.LocationHelpers.GetLineSpan(this SyntaxToken token) while SyntaxToken was None (I guess default value) so the 'token.SyntaxTree' was null.
In method SA1500CodeFixProvider.GenerateBraceFixes the state was:
'braceToken' = CloseBraceToken
'previousToken' = CloseBraceToken
'nextToken' = None
then there follows call 'LocationHelpers.GetLineSpan(nextToken)'.
Stack is here:
The text was updated successfully, but these errors were encountered: