0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-21 23:03:11 -05:00

Fix crash extracting contents of range

endContainer can be null here.
This commit is contained in:
Neil Jenkins 2024-07-23 14:16:36 +10:00
parent af26ba85d2
commit 3c8f0cd89b

View file

@ -134,7 +134,7 @@ const extractContentsOfRange = (
}
// Merge text nodes if adjacent
node = endContainer.previousSibling;
node = endContainer && endContainer.previousSibling;
if (node && node instanceof Text && endContainer instanceof Text) {
endOffset = node.length;
node.appendData(endContainer.data);