From e6ea47e75f4c207c6a4373649f996933ca085d84 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 17 May 2022 12:26:29 +0200 Subject: [PATCH] Bugfix: startBlock could be null --- vendors/squire/build/squire-raw.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vendors/squire/build/squire-raw.js b/vendors/squire/build/squire-raw.js index 8fae8f5bf..1d0b198b0 100644 --- a/vendors/squire/build/squire-raw.js +++ b/vendors/squire/build/squire-raw.js @@ -1012,8 +1012,13 @@ const rangeDoesStartAtBlockBoundary = ( range, root ) => { let startContainer = range.startContainer; let startOffset = range.startOffset; + let startBlock = getStartBlockOfRange( range, root ); let nodeAfterCursor; + if (!startBlock) { + return false; + } + // If in the middle or end of a text node, we're not at the boundary. if ( startContainer.nodeType === TEXT_NODE ) { if ( startOffset ) {