Fix for #52 NPE on submitting empty login form

Fix for #52 NPE on submitting empty login form. Builds upon #53 .