Skip to content

Commit

Permalink
Merge pull request #15169 from Snuffleupagus/loadFont-fontRef
Browse files Browse the repository at this point in the history
Handle errors in the "Loading by ref" code-path in `PartialEvaluator.loadFont`
  • Loading branch information
Snuffleupagus authored Jul 15, 2022
2 parents 3256761 + acd61a1 commit 75b8647
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,9 @@ class PartialEvaluator {
let fontRef;
if (font) {
// Loading by ref.
if (!(font instanceof Ref)) {
throw new FormatError('The "font" object should be a reference.');
if (font instanceof Ref) {
fontRef = font;
}
fontRef = font;
} else {
// Loading by name.
const fontRes = resources.get("Font");
Expand Down

0 comments on commit 75b8647

Please sign in to comment.