Skip to content

Commit

Permalink
Merge pull request #3280 from WordPress/fix/collapsed-null-bug
Browse files Browse the repository at this point in the history
Fix for calling collapsed of null
  • Loading branch information
mcsf authored Nov 2, 2017
2 parents f4a9bff + 50660df commit 55c54f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function isVerticalEdge( container, isReverse, collapseRanges = false ) {

const selection = window.getSelection();
let range = selection.rangeCount ? selection.getRangeAt( 0 ) : null;
if ( collapseRanges && ! range.collapsed ) {
if ( collapseRanges && range && ! range.collapsed ) {
const newRange = document.createRange();
// Get the end point of the selection (see focusNode vs. anchorNode)
newRange.setStart( selection.focusNode, selection.focusOffset );
Expand Down

0 comments on commit 55c54f6

Please sign in to comment.