Fix NullReferenceException in GetEnrollmentResult for null DCV email#9
Open
bhillkeyfactor wants to merge 2 commits into
Open
Fix NullReferenceException in GetEnrollmentResult for null DCV email#9bhillkeyfactor wants to merge 2 commits into
bhillkeyfactor wants to merge 2 commits into
Conversation
The condition for adding DCV email entries to the cnames dictionary was inverted (string.IsNullOrEmpty instead of !string.IsNullOrEmpty), causing cnames.Add(null, null) and an ArgumentNullException on every enrollment where CSC returned a DcvDetail with email=null (typical for EMAIL DCV orders that have actionNeeded=N, and for CNAME-only DCV). Inverts the condition and adds a ContainsKey guard to mirror the existing CName branch.
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.
Summary
Fixes an ArgumentNullException (Value cannot be null. Parameter 'key') thrown from RequestManager.GetEnrollmentResult on every CSC enrollment where CSC returns a DcvDetail with email=null (typical for EMAIL DCV orders that come back with actionNeeded=N, and for CNAME-only DCV).
The condition for adding DCV email entries to the cnames dictionary was inverted: when dcv.Email was null, the original code entered the branch and called cnames.Add(null, null), throwing immediately. The new condition skips null/empty values (matching the intent) and adds a ContainsKey guard symmetric to the existing CName branch above.
Test plan