From e07fc77a529b1787e9de6210d3e1b56d7569ed27 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Feb 2015 13:18:26 +0530 Subject: [PATCH] Edit Book: Reports tool: Fix double clicking on an unused image causing an error --- src/calibre/gui2/tweak_book/reports.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/reports.py b/src/calibre/gui2/tweak_book/reports.py index dd397a75ac..0f7b9ef528 100644 --- a/src/calibre/gui2/tweak_book/reports.py +++ b/src/calibre/gui2/tweak_book/reports.py @@ -336,9 +336,10 @@ class Jump(object): self.pos_map.clear() def __call__(self, key, locations): - self.pos_map[key] = (self.pos_map[key] + 1) % len(locations) - loc = locations[self.pos_map[key]] - jump_to_location(loc) + if len(locations): + self.pos_map[key] = (self.pos_map[key] + 1) % len(locations) + loc = locations[self.pos_map[key]] + jump_to_location(loc) jump = Jump() # }}}