Don't pass nil email address to EmailChecker #10041
Merged
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.
Context
In production we have over 12k application references with nil email addresses.
The EmailChecker class expects an email and not a nil value. This creates a few exceptions when a candidate inputs a reference.
The form is saved to DB once the candidate adds a name to the reference, if the candidate moves on, the reference is saved in DB, without a email. So this might be a way we got 12k references without an email.
This commit tries to make sure this class doesn't receive a nil parameter.
https://dfe-teacher-services.sentry.io/issues/6047049953/events/ce842c5fdcad4b9d91787920e1098f91/?environment=production&project=1765973&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&referrer=previous-event&statsPeriod=24h&stream_index=2
Changes proposed in this pull request
Guidance to review
Things to check