Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iot-device): Fix NullReferenceException in MqttTransportHandler #1735

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

abhipsaMisra
Copy link
Member

_disconnectAwaitersCancellationSource CancellationTokenSource is disposed (and set to null) when the transport handler is disposed. Since this cts ;lifecycle is also managed through a scheduled cleanup task, which can run on a different thread in the event of an exception, we need to perform a null check before attempting cancellation.
Failure to do so ends in the code throwing a NullReferenceException.

@abhipsaMisra
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@abhipsaMisra abhipsaMisra merged commit 41cc1d3 into master Jan 5, 2021
@abhipsaMisra abhipsaMisra deleted the abmisr/mqttCtsDispose branch January 5, 2021 01:14
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