Skip to content

Fix NullReferenceException in HttpChain when _handlerType is null#2151

Merged
jeremydmiller merged 1 commit intomainfrom
GH2092
Feb 9, 2026
Merged

Fix NullReferenceException in HttpChain when _handlerType is null#2151
jeremydmiller merged 1 commit intomainfrom
GH2092

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Fixes System.NullReferenceException: Object reference not set to an instance of an object. #2092: NullReferenceException when hitting F# (or simple static) HTTP endpoints after upgrading to Wolverine 5.10
  • AttachTypesSynchronously now falls back to assembly.GetTypes() when the generated handler type isn't found in ExportedTypes
  • Extracted buildHandler() method with a descriptive error message, replacing the misleading "concurrent access" catch block
  • Added F# and C# sample endpoints with tests verifying both discovery and end-to-end behavior

Test plan

  • New F# endpoint (/fsharp/is-authenticated) discovered and returns correct response
  • New C# static endpoint (/simple/bool) discovered and returns correct response
  • All 474 existing Wolverine.Http.Tests pass (1 unrelated Postgres connectivity failure)

🤖 Generated with Claude Code

…oses GH-2092

The generated handler type lookup in AttachTypesSynchronously only searched
assembly.ExportedTypes. Added fallback to assembly.GetTypes() for cases where
the type isn't publicly exported. Extracted buildHandler() with a descriptive
error message replacing the misleading "concurrent access" catch block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

System.NullReferenceException: Object reference not set to an instance of an object.

1 participant