mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 12:41:44 +02:00
add null-guard in case marks = undefined (default state) (#1958)
This commit is contained in:
committed by
Ian Storm Taylor
parent
910e983215
commit
ad9831f458
@@ -875,7 +875,7 @@ Changes.insertTextAtRange = (change, range, text, marks, options = {}) => {
|
|||||||
|
|
||||||
// PERF: Unless specified, don't normalize if only inserting text.
|
// PERF: Unless specified, don't normalize if only inserting text.
|
||||||
if (normalize === undefined) {
|
if (normalize === undefined) {
|
||||||
normalize = range.isExpanded && marks.size !== 0
|
normalize = range.isExpanded && marks && marks.size !== 0
|
||||||
}
|
}
|
||||||
|
|
||||||
change.insertTextByKey(key, offset, text, marks, { normalize: false })
|
change.insertTextByKey(key, offset, text, marks, { normalize: false })
|
||||||
|
Reference in New Issue
Block a user