From 625d369c33338f6c7d143a0702d46ec4c7ef71ae Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 May 2014 23:17:05 +0200 Subject: [PATCH] Add check for modeman.mode property --- qutebrowser/keyinput/modeman.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/keyinput/modeman.py b/qutebrowser/keyinput/modeman.py index db62ccb18..8abce25dc 100644 --- a/qutebrowser/keyinput/modeman.py +++ b/qutebrowser/keyinput/modeman.py @@ -228,7 +228,14 @@ class ModeManager(QObject): Emit: key_pressed: When a key was actually pressed. """ - if self.mode is None: + if not hasattr(self, 'mode'): + # FIXME I have no idea how this could possibly happen, but on + # Ubuntu it does on startup. + # self.mode is a simple @property and we certainly don't delete it, + # so this all makes no sense at all. + logging.warn("eventFilter called but self.mode doesn't exist!") + return False + elif self.mode is None: # We got events before mode is set, so just pass them through. return False typ = event.type()