mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #15169 from Snuffleupagus/loadFont-fontRef
Handle errors in the "Loading by ref" code-path in `PartialEvaluator.loadFont`
This commit is contained in:
commit
75b8647a32
1 changed files with 2 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue