Bugfix: startBlock could be null

This commit is contained in:
the-djmaze 2022-05-17 12:26:29 +02:00
parent 663fb1485a
commit e6ea47e75f

View file

@ -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 ) {