Fixed a null pointer during the login procedure