From bc5b4d902f32379f95289b4b317c0f4e3133184f Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 12 May 2011 18:14:10 +0100 Subject: [PATCH] Fix LP Bug #779074 - TypeError in on_key_press_event(): cannot concatenate 'str' and 'NoneType' --- deluge/ui/gtkui/torrentview.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 8b2b96a29..4fc5ce331 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -567,9 +567,10 @@ class TorrentView(listview.ListView, component.Component): # Handle keyboard shortcuts def on_key_press_event(self, widget, event): keyname = gtk.gdk.keyval_name(event.keyval) - func = getattr(self, 'keypress_' + keyname, None) - if func: - return func(event) + if keyname is not None: + func = getattr(self, 'keypress_' + keyname, None) + if func: + return func(event) def keypress_Delete(self, event): log.debug("keypress_Delete")