mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
fix: removeNodeOp throwing an error
This commit is contained in:
parent
bb04f2d81c
commit
c4eb8578f1
@ -41,7 +41,7 @@ const removeNodeOp = ({ index, obj, path }: Automerge.Diff) => (
|
||||
const slatePath = toSlatePath(path)
|
||||
|
||||
const parent = getTarget(doc, slatePath)
|
||||
const target = parent?.children[index as number] || { children: [] }
|
||||
const target = parent?.children?.[index as number] || { children: [] }
|
||||
|
||||
if (!map.hasOwnProperty(obj)) {
|
||||
map[obj] = target
|
||||
|
Loading…
Reference in New Issue
Block a user