mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 06:53:25 +02:00
Deal with invalid range passed to getSelectionIndexes (#1443)
* Deal with invalid range in getSelectionIndexes * Use range is unset
This commit is contained in:
committed by
Ian Storm Taylor
parent
cef33de6aa
commit
b2e0612149
@@ -1405,6 +1405,11 @@ class Node {
|
|||||||
return null
|
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
|
// PERF: if the start and end keys are the same, just check for the child
|
||||||
// that contains that single key.
|
// that contains that single key.
|
||||||
if (startKey == endKey) {
|
if (startKey == endKey) {
|
||||||
|
Reference in New Issue
Block a user