From 11bdf9669cea7510cee52460dfbc1d85b2aaae87 Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Sat, 15 Apr 2017 05:36:44 -0500 Subject: [PATCH] fix Attribute/TypeErrors when quitting before logging in --- clients/urwid/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index be559c5..204f165 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -1404,8 +1404,10 @@ def frilly_exit(): and shit, or just say bye, depending on the user's bbjrc setting, `dramatic_exit` """ - app.loop.stop() - if app.prefs["dramatic_exit"]: + # sometimes this gets called before the loop is set up properly + try: app.loop.stop() + except: pass + if app.prefs["dramatic_exit"] and app.loop.screen_size: width, height = app.loop.screen_size for x in range(height - 1): motherfucking_rainbows(