Skip to content

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.

1 participant