Fix NRE in DurableReceiver when Listener is null during redelivery#2263
Merged
jeremydmiller merged 1 commit intomainfrom Mar 5, 2026
Merged
Fix NRE in DurableReceiver when Listener is null during redelivery#2263jeremydmiller merged 1 commit intomainfrom
jeremydmiller merged 1 commit intomainfrom
Conversation
…ivery When DurableReceiver is latched and receives an envelope, it posts to _deferBlock before MarkReceived sets envelope.Listener, causing a NullReferenceException. Added a null guard consistent with all other _deferBlock and _completeBlock call sites in the class. Closes #2258 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 9, 2026
This was referenced Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DurableReceiveris latched and receives an envelope,ReceivedAsyncposts to_deferBlock(line 252) beforeMarkReceivedsetsenvelope.Listener, causingenv.Listener!.DeferAsync(env)to throw aNullReferenceException.envelope.Listenerbefore posting to_deferBlock, consistent with every other call site for_deferBlockand_completeBlockin the class (lines 201, 258, 375, 436, 446).Closes #2258
Test plan
durable_receiver_latched_without_listener.should_not_throw_nre_and_should_not_invoke_pipeline— verifies no NRE when listener is nulldurable_receiver_latched_without_listener.should_defer_on_listener_when_envelope_has_listener— verifies defer still works when listener is present🤖 Generated with Claude Code