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

Fix TypeError on Document::getFirstFont when no fonts are available #461

Merged
merged 3 commits into from
Oct 1, 2021
Merged

Fix TypeError on Document::getFirstFont when no fonts are available #461

merged 3 commits into from
Oct 1, 2021

Conversation

PrinsFrank
Copy link
Contributor

When there is no font available in a document, an empty array is passed to the reset function. Reset can return "false if the array is empty", causing a TypeError as the return type of the function "getFirstFont" is set to "?Font". This PR fixes this issue.

prinsfrank added 2 commits September 24, 2021 11:11
…eturns false on empty arrays and the return type doesn't allow bools
@PrinsFrank PrinsFrank changed the title Fix get first font type error Fix TypeError on Document::getFirstFont when no fonts are available Sep 24, 2021
@k00ni k00ni added the fix label Sep 24, 2021
Copy link
Collaborator

@k00ni k00ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@k00ni k00ni merged commit ba3f039 into smalot:master Oct 1, 2021
@PrinsFrank PrinsFrank deleted the fix-get-first-font-type-error branch October 1, 2021 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants