Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix template selection #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snototter
Copy link

@snototter snototter commented Nov 6, 2021

During initialization of DocumentPage instances, a bug caused rmrl to always render the template of the notebook's last page. The bugfix is trivial since this was only a mix-up (max instead of min).

For more context (if needed) - consider the inline documentation prior to the culprit line:

rmrl/rmrl/document.py

Lines 60 to 64 in 89b5cc3

# I have encountered an issue with some PDF files, where the
# rM won't save the page template for later pages. In this
# case, just take the last-available page template, which
# is usually 'Blank'.
template_name = template_names[max(self.num, len(template_names) - 1)]

In such cases, len(template_names) would be less than self.num. Access with max would then raise an IndexError.
For all other exports (where self.num is always less than len(template_names)), this line will always select the last entry within template_names.

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.

None yet

1 participant