Fixed a bug - no panic anymore when logining in without TTY

Fixes #8956

Signed-off-by: Marianna <mtesselh@gmail.com>
Merge pull request #9211 from mtesselH/login

Fixed a bug - no panic anymore when logining in without TTY