diff --git a/src/display/pdf_objects.js b/src/display/pdf_objects.js index eccbe6a72..5f8edd82c 100644 --- a/src/display/pdf_objects.js +++ b/src/display/pdf_objects.js @@ -100,6 +100,9 @@ class PDFObjects { */ resolve(objId, data = null) { const obj = this.#ensureObj(objId); + if (obj.data !== INITIAL_DATA) { + throw new Error(`Object already resolved ${objId}.`); + } obj.data = data; obj.resolve(); }