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 NRE in TwinManager #300

Merged
merged 3 commits into from
Sep 17, 2018
Merged

Fix NRE in TwinManager #300

merged 3 commits into from
Sep 17, 2018

Conversation

myagley
Copy link
Contributor

@myagley myagley commented Sep 17, 2018

An NRE is possible in the TwinManager under the following sequence of events:

  1. Device is offline
  2. Send reported property patch for a device before ever calling get twin
  3. Call get twin

null is used as a placeholder in the TwinManager when a reported property update is made with no twin. A get twin on this identity results in null being returned, which violates assumptions in the rest of the codebase.

This was found via a failing CI test. The test case needed to be adjusted as well because of the changes for extended offline.

@myagley myagley closed this Sep 17, 2018
@myagley myagley reopened this Sep 17, 2018
@myagley myagley closed this Sep 17, 2018
@myagley myagley reopened this Sep 17, 2018
@myagley myagley merged commit 0b4ef50 into Azure:master Sep 17, 2018
@myagley myagley deleted the miyagley/ci-fix-eh branch September 17, 2018 22:21
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