fix array iterator on merged content. fixes #152

This commit is contained in:
Kevin Jahns
2019-05-25 12:49:08 +02:00
parent 668e9e8a9b
commit ef6c382e20
2 changed files with 18 additions and 9 deletions

View File

@@ -287,16 +287,13 @@ export const typeListCreateIterator = type => {
while (n !== null && n.deleted) {
n = n.right
}
}
// check if we reached the end, no need to check currentContent, because it does not exist
if (n === null) {
return {
done: true,
value: undefined
// check if we reached the end, no need to check currentContent, because it does not exist
if (n === null) {
return {
done: true,
value: undefined
}
}
}
// currentContent could exist from the last iteration
if (currentContent === null) {
// we found n, so we can set currentContent
currentContent = n.getContent()
currentContentIndex = 0