Skip to content

Fix NullReferenceException in VisitIdentifierName when calling GetSymbolInfo#102

Open
slang25 wants to merge 1 commit intosourcegraph:mainfrom
slang25:fix-NRE
Open

Fix NullReferenceException in VisitIdentifierName when calling GetSymbolInfo#102
slang25 wants to merge 1 commit intosourcegraph:mainfrom
slang25:fix-NRE

Conversation

@slang25
Copy link

@slang25 slang25 commented Feb 25, 2026

Summary

  • Wraps the GetSymbolInfo call in VisitIdentifierName in a try/catch (NullReferenceException) to prevent scip-dotnet crashing when Roslyn's CSharpSemanticModel.AddReducedAndFilteredMethodGroupSymbol throws on certain C# code patterns
  • The indexer now silently skips problematic nodes rather than crashing

Inspired by the workaround in justeattakeaway/JustSaying#1946, applying the fix directly to the source rather than as a build-time patch.

Test plan

  • Run scip-dotnet against a codebase that previously triggered the NullReferenceException and confirm it completes successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant