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

Handle null parentElement for selection anchor

This commit is contained in:
Alf Eaton 2024-10-11 13:58:06 +01:00 committed by GitHub
parent c6d01caf65
commit e97e9c93d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -299,7 +299,7 @@ class TextLayerBuilder {
anchor = anchor.parentNode;
}
const parentTextLayer = anchor.parentElement.closest(".textLayer");
const parentTextLayer = anchor.parentElement?.closest(".textLayer");
const endDiv = this.#textLayers.get(parentTextLayer);
if (endDiv) {
endDiv.style.width = parentTextLayer.style.width;