1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 13:41:19 +02:00

Fix error in insertFragmentAtRange

This commit is contained in:
Samy Pessé
2016-11-03 09:57:41 +01:00
parent 57a62d1373
commit ca14f242c2

View File

@@ -1,5 +1,6 @@
/* eslint no-console: 0 */
import { List } from 'immutable'
import Normalize from '../utils/normalize'
/**
@@ -368,7 +369,7 @@ export function insertFragmentAtRange(transform, range, fragment, options = {})
if (firstBlock != lastBlock) {
const nextChild = startBlock.getNextSibling(startChild.key)
const nextNodes = startBlock.nodes.skipUntil(n => n.key == nextChild.key)
const nextNodes = nextChild ? startBlock.nodes.skipUntil(n => n.key == nextChild.key) : List()
const lastIndex = lastBlock.nodes.size
nextNodes.forEach((node, i) => {