aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-17 21:05:48 +0700
committerwustho <benawiadha@gmail.com>2020-04-17 21:05:48 +0700
commitb4a5cf84b56b4af1f35f95992830a7ccde4334b9 (patch)
tree1358390ae29653d5addc31e085d0d5f5f947ec9a /epy.py
parent3848d56d21a8e429a9997643c70de613f7f7f7fb (diff)
downloadepy-b4a5cf84b56b4af1f35f95992830a7ccde4334b9.tar.gz
Fix IndexError when BeginningofCh was pressed while toc_entries=[[],[],[]].
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/epy.py b/epy.py
index c485d94..3b63fe5 100755
--- a/epy.py
+++ b/epy.py
@@ -1131,7 +1131,7 @@ def reader(ebook, index, width, y, pctg, sect):
ntoc = find_curr_toc_id(toc_idx, toc_sect, toc_secid, index, y)
try:
y = toc_secid[toc_sect[ntoc]]
- except KeyError:
+ except (KeyError, IndexError):
y = 0
elif k in K["EndOfCh"]:
ntoc = find_curr_toc_id(toc_idx, toc_sect, toc_secid, index, y)