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
@ -1176,10 +1176,9 @@ class PartialEvaluator {
|
|||||||
let fontRef;
|
let fontRef;
|
||||||
if (font) {
|
if (font) {
|
||||||
// Loading by ref.
|
// Loading by ref.
|
||||||
if (!(font instanceof Ref)) {
|
if (font instanceof Ref) {
|
||||||
throw new FormatError('The "font" object should be a reference.');
|
fontRef = font;
|
||||||
}
|
}
|
||||||
fontRef = font;
|
|
||||||
} else {
|
} else {
|
||||||
// Loading by name.
|
// Loading by name.
|
||||||
const fontRes = resources.get("Font");
|
const fontRes = resources.get("Font");
|
||||||
|
Loading…
Reference in New Issue
Block a user