mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-01 05:16:10 +01:00
add null-guard in case marks = undefined (default state) (#1958)
This commit is contained in:
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.
|
||||
if (normalize === undefined) {
|
||||
normalize = range.isExpanded && marks.size !== 0
|
||||
normalize = range.isExpanded && marks && marks.size !== 0
|
||||
}
|
||||
|
||||
change.insertTextByKey(key, offset, text, marks, { normalize: false })
|
||||
|
Loading…
x
Reference in New Issue
Block a user