From bd6541864b334842711bebd9d615d42dfb722651 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 21 Jun 2026 09:13:33 +0200 Subject: [PATCH] Don't swallow `MissingDataException`s 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. --- src/core/annotation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/annotation.js b/src/core/annotation.js index 0fd275c74..0a1a46bd9 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -48,6 +48,7 @@ import { lookupMatrix, lookupNormalRect, lookupRect, + MissingDataException, numberToString, RESOURCES_KEYS_OPERATOR_LIST, RESOURCES_KEYS_TEXT_CONTENT, @@ -1208,6 +1209,9 @@ class Annotation { /* resources = */ null ); } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn(`#setOptionalContent: ${ex}`); } }