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

Fixes #8956

Signed-off-by: Marianna <mtesselh@gmail.com>