Added null-handling when recording host startup exception to current … - #1438
Merged
danielgerlag merged 1 commit intoSep 6, 2026
Conversation
danielgerlag
approved these changes
Sep 6, 2026
danielgerlag
left a comment
Owner
There was a problem hiding this comment.
LGTM. StartHost() can return null when ActivitySource has no listeners (StartActivity contract); finally already used activity?.Dispose(), catch did not — this was masking real startup failures behind an NRE. One-line fix is correct.
2 tasks
danielgerlag
added a commit
that referenced
this pull request
Sep 7, 2026
* Bump version to 3.21.0 Ship the host-startup Activity NRE fix (#1438), PostgreSQL Delay timezone fix (#1425 / #1440), and Cosmos DI client overload (#1439 / #1424). Co-authored-by: Daniel Gerlag <danielgerlag@users.noreply.github.com> * Fix EF DateTime timezone mismatch hanging Delay on PostgreSQL Same change as #1425 / #1440. Included here so 3.21.0 ships the fix even if the Copilot PR remains blocked by the coding-agent review rule. Co-authored-by: Daniel Gerlag <danielgerlag@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Daniel Gerlag <danielgerlag@users.noreply.github.com>
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.
Describe the change
In WorkflowHost StartAsync if any exception occures, and there is no ActivityListener for WorkflowCore, then the catch block throws NullReferenceException due to accessing the null activity. This hides the original startup exception and makes impossible to see what had actually happen (eg. RabbitMQ queue provider connection issue, etc.)
Describe your implementation or design
Added a null-conditional operator to AddException
Tests
No
Breaking change
No