Skip to content

fix: return 0 instead of None when calculate_page_offset has no valid pairs - #466

Open
LCARyanKing wants to merge 1 commit into
VectifyAI:mainfrom
LCARyanKing:fix/calculate-page-offset-returns-none
Open

fix: return 0 instead of None when calculate_page_offset has no valid pairs#466
LCARyanKing wants to merge 1 commit into
VectifyAI:mainfrom
LCARyanKing:fix/calculate-page-offset-returns-none

Conversation

@LCARyanKing

Copy link
Copy Markdown

Fixes a crash when processing PDFs that have no matching page pairs between the table of contents page numbers and physical indices.

When calculate_page_offset() cannot determine an offset (no valid pairs), it now returns 0 instead of None, allowing add_page_offset_to_toc_json() to safely perform arithmetic operations.

… pairs

Fixes a crash in standard mode when processing PDFs that have no matching page pairs between the table of contents page numbers and physical indices.

When calculate_page_offset() cannot determine an offset (no valid pairs), it now returns 0 instead of None, allowing add_page_offset_to_toc_json() to safely perform arithmetic operations.
@LCARyanKing

Copy link
Copy Markdown
Author

This is related to issue: #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant