Don't attempt to use the cursor selection when it has length 0

RTWYSIWYG-20
RTWYSIWYG-24
This commit is contained in:
ansuz 2016-03-22 10:06:42 +01:00
parent 5cd118bdb0
commit bd24821c6c

View file

@ -136,10 +136,9 @@ define([
verbose("cursor.update");
root = root || inner;
sel = sel || Rangy.getSelection(root);
// FIXME under what circumstances are no ranges found?
if (!sel.rangeCount) {
error('[cursor.update] no ranges found');
//return 'no ranges found';
return;
}
var range = sel.getRangeAt(0);