Skip to content

Added null-handling when recording host startup exception to current … - #1438

Merged
danielgerlag merged 1 commit into
danielgerlag:masterfrom
cervengoc:bug/nullrefexception-hides-startup-exceptions
Sep 6, 2026
Merged

Added null-handling when recording host startup exception to current …#1438
danielgerlag merged 1 commit into
danielgerlag:masterfrom
cervengoc:bug/nullrefexception-hides-startup-exceptions

Conversation

@cervengoc

Copy link
Copy Markdown
Contributor

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

@danielgerlag danielgerlag left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@danielgerlag
danielgerlag merged commit 070175e into danielgerlag:master Sep 6, 2026
8 of 11 checks passed
cursor Bot pushed a commit that referenced this pull request Sep 6, 2026
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>
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>
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.

3 participants