Skip to content

Commit

Permalink
Don't pass nil email address to EmailChecker
Browse files Browse the repository at this point in the history
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.

This commit tries to make sure this class doesn't receive a nil parameter.
  • Loading branch information
CatalinVoineag committed Nov 8, 2024
1 parent 37aebfa commit ada9834
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def references_with_personal_email_addresses?
application_form.unsubmitted? &&
# One or more of the professional references has a personal email address
application_form.application_references.pluck(:referee_type, :email_address).any? do |referee_type, email_address|
referee_type != 'character' && EmailChecker.new(email_address).personal?
referee_type != 'character' && email_address.present? && EmailChecker.new(email_address).personal?
end
end

Expand Down

0 comments on commit ada9834

Please sign in to comment.