Work with case-sensitive email addresses

Closes #4235
Thanks for the comment, I added an `if` to catch an `undefined` return value.