Skip to content

Commit 584a9c9

Browse files
committed
Fix offset defaulting to 0 when calculate_page_offset returns None
1 parent d79c1a2 commit 584a9c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pageindex/page_index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,8 @@ def process_toc_with_page_numbers(toc_content, toc_page_list, page_list, toc_che
632632
logger.info(f'matching_pairs: {matching_pairs}')
633633

634634
offset = calculate_page_offset(matching_pairs)
635+
if offset is None:
636+
offset = 0
635637
logger.info(f'offset: {offset}')
636638

637639
toc_with_page_number = add_page_offset_to_toc_json(toc_with_page_number, offset)

0 commit comments

Comments
 (0)