Skip to content

Add TaskContext null check in AsyncTaskActivity error handling#1055

Merged
cgillum merged 2 commits intoAzure:mainfrom
leoquijano:leoquijano/task-context-nullable-check
Mar 21, 2024
Merged

Add TaskContext null check in AsyncTaskActivity error handling#1055
cgillum merged 2 commits intoAzure:mainfrom
leoquijano:leoquijano/task-context-nullable-check

Conversation

@leoquijano
Copy link
Contributor

This PR adds a null check during error handling in AsyncTaskActivity. As described in #1054, if the context parameter is passed as null to RunAsync, and the call to ExecuteAsync fails for some task-specific reason, the error handling code uses that parameter to check which error propagation mode is being used. If the parameter is null, an unexpected NullReferenceException will be raised, instead of the expected TaskFailureException.

A null check is added to prevent this from happening.

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

LGTM!

@cgillum
Copy link
Member

cgillum commented Mar 20, 2024

/azp run

@azure-pipelines
Copy link

azure-pipelines bot commented Mar 20, 2024

EDIT: Azure Pipelines run started successfully.

@cgillum cgillum merged commit 336c957 into Azure:main Mar 21, 2024
@leoquijano leoquijano deleted the leoquijano/task-context-nullable-check branch March 21, 2024 02:00
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.

2 participants