MDL-51837 user: Check if user email is set on validation
MDL-51837 user: Check if user email is set on validation

Add a check if the user's email is set before performing validation on
the user's email address. This is to prevent the warning messages to
be shown in the case of a pending email change which causes the user's
email field to be not included in the Edit profile form.

dilawar/moodle