Fix crash dismissing the Login view prematurely