Fix #4304 - Blank password is tried when it shouldn't happen

Fix #4304
Land #4313, @wchen-r7's fix for #4304