mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-28 09:57:21 +02:00
Don't swallow MissingDataExceptions in the Annotation.prototype.#setOptionalContent method (PR 21313 follow-up)
Unless the entire document has been loaded, the dictionary lookups in `parseMarkedContentProps` may throw `MissingDataException`s and in that case we need to re-parse the current Annotation rather than ignoring the optionalContent.
This commit is contained in:
parent
124228e318
commit
bd6541864b
@ -48,6 +48,7 @@ import {
|
|||||||
lookupMatrix,
|
lookupMatrix,
|
||||||
lookupNormalRect,
|
lookupNormalRect,
|
||||||
lookupRect,
|
lookupRect,
|
||||||
|
MissingDataException,
|
||||||
numberToString,
|
numberToString,
|
||||||
RESOURCES_KEYS_OPERATOR_LIST,
|
RESOURCES_KEYS_OPERATOR_LIST,
|
||||||
RESOURCES_KEYS_TEXT_CONTENT,
|
RESOURCES_KEYS_TEXT_CONTENT,
|
||||||
@ -1208,6 +1209,9 @@ class Annotation {
|
|||||||
/* resources = */ null
|
/* resources = */ null
|
||||||
);
|
);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
if (ex instanceof MissingDataException) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
warn(`#setOptionalContent: ${ex}`);
|
warn(`#setOptionalContent: ${ex}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user