Merge pull request #406 from snakecase/patch-2

Fix check for an empty input or ESC key press
This commit is contained in:
Ilya Kantor 2018-03-31 22:59:08 +03:00 committed by GitHub
commit 63e1268574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,13 +9,13 @@ if (userName == 'Admin') {
if (pass == 'TheMaster') {
alert( 'Welcome!' );
} else if (pass == null) {
} else if (pass == '' || pass == null) {
alert( 'Canceled.' );
} else {
alert( 'Wrong password' );
}
} else if (userName == null) {
} else if (userName == '' || userName == null) {
alert( 'Canceled' );
} else {
alert( "I don't know you" );