Fix LP Bug #779074 - TypeError in on_key_press_event(): cannot concatenate 'str' and 'NoneType'

This commit is contained in:
Calum Lind 2011-05-12 18:14:10 +01:00
parent 6a8e3f1c49
commit bc5b4d902f
1 changed files with 4 additions and 3 deletions

View File

@ -567,6 +567,7 @@ class TorrentView(listview.ListView, component.Component):
# Handle keyboard shortcuts
def on_key_press_event(self, widget, event):
keyname = gtk.gdk.keyval_name(event.keyval)
if keyname is not None:
func = getattr(self, 'keypress_' + keyname, None)
if func:
return func(event)