1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Catch and ignore any errors during auto-linking parsing (PR 19110 follow-up)

While investigating a bug, that I've not yet had time to fully investigate and report, I found that if there's ever an error thrown from the `Autolinker` class it'll prevent the annotationEditorLayer from rendering *and* the renderTask itself will be treated as having failed.
This commit is contained in:
Jonas Jenwald 2025-02-10 16:19:41 +01:00
parent de1c2146b8
commit 357ff4afde

View file

@ -1112,12 +1112,17 @@ class PDFPageView {
await this.#renderAnnotationLayer();
if (this.#enableAutoLinking) {
await textLayerPromise;
this.annotationLayer?.injectLinkAnnotations({
inferredLinks: Autolinker.processLinks(this),
viewport: this.viewport,
structTreeLayer: this.structTreeLayer,
});
try {
await textLayerPromise;
this.annotationLayer?.injectLinkAnnotations({
inferredLinks: Autolinker.processLinks(this),
viewport: this.viewport,
structTreeLayer: this.structTreeLayer,
});
} catch (ex) {
console.error("enableAutoLinking:", ex);
}
}
}