1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01:00

Deal with invalid range passed to getSelectionIndexes (#1443)

* Deal with invalid range in getSelectionIndexes

* Use range is unset
This commit is contained in:
Conor Cussell 2017-12-11 15:54:46 +01:00 committed by Ian Storm Taylor
parent cef33de6aa
commit b2e0612149

View File

@ -1405,6 +1405,11 @@ class Node {
return null
}
// if we've been given an invalid selection we can exit early.
if (range.isUnset) {
return null
}
// PERF: if the start and end keys are the same, just check for the child
// that contains that single key.
if (startKey == endKey) {