From 3ffef84a434783dd5231100ed2ed3d36ff193607 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Aug 2011 10:25:45 -0600 Subject: [PATCH] ... --- src/calibre/gui2/keyboard.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index 6f8b217d35..f379bc66b6 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -452,7 +452,9 @@ class Delegate(QStyledItemDelegate): # {{{ def to_doc(self, index): data = index.data(Qt.UserRole).toPyObject() - if data.is_shortcut: + if data is None: + html = _('An unknown error occurred') + elif data.is_shortcut: shortcut = data.data # Shortcut keys = [unicode(k.toString(k.NativeText)) for k in shortcut['keys']]