Fixes #4347: correct detection of empty password/username