1
0
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:
Michael Telatynski 2018-07-19 19:56:07 +01:00 committed by Ian Storm Taylor
parent 910e983215
commit ad9831f458

View File

@ -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 })