Merge pull request #18884 from hubgit/patch-1

Handle null parentElement for selection anchor
This commit is contained in:
Tim van der Meij 2024-10-15 20:55:23 +02:00 committed by GitHub
commit 96bced7f5b
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;