Add custom username field test before checking value

This commit is contained in:
Jeremy Zhang 2018-04-04 18:14:37 +00:00
parent 8ff9313af9
commit f037ed15cd

View File

@ -398,7 +398,7 @@
unlock_login_fields(); unlock_login_fields();
if (data.status == 403 && getParameterByName("create_authenticated_user") == "true" && getParameterByName("sametarget") == "true") { if (data.status == 403 && getParameterByName("create_authenticated_user") == "true" && getParameterByName("sametarget") == "true") {
wait_for_discord_login(); wait_for_discord_login();
} else if (!unauth_captcha_enabled && $("#custom_username_field").val().trim() !== "") { } else if (!unauth_captcha_enabled && $("#custom_username_field").length !== 0 && $("#custom_username_field").val().trim() !== "") {
$("#custom_username_field").trigger(jQuery.Event("keyup", { keyCode: 13 } )); $("#custom_username_field").trigger(jQuery.Event("keyup", { keyCode: 13 } ));
} else if (visitors_enabled) { } else if (visitors_enabled) {
setVisitorMode(true); setVisitorMode(true);