From 5b33fe688491ad8e8d426db0cc30f4a06164ac29 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Sep 2020 08:38:02 +0530 Subject: [PATCH] Fix double clicking on chapter heading in highlights panel causing an exception --- src/calibre/gui2/viewer/highlights.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index 6519ca43ca..05fe825139 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -292,7 +292,9 @@ class Highlights(QTreeWidget): return False def item_activated(self, item): - self.jump_to_highlight.emit(item.data(0, Qt.UserRole)) + h = item.data(0, Qt.UserRole) + if h is not None: + self.jump_to_highlight.emit(h) @property def current_highlight(self):