Merge pull request #3680 from matrix-org/travis/fix-list-diff

Don't assume that diffs will have an appropriate child node
This commit is contained in:
Travis Ralston 2019-11-28 09:10:43 -07:00 committed by GitHub
commit 01ba4aca45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,8 @@ function findRefNodes(root, route, isAddition) {
const end = isAddition ? route.length - 1 : route.length;
for (let i = 0; i < end; ++i) {
refParentNode = refNode;
// Lists don't have appropriate child nodes we can use.
if (!refNode.childNodes[route[i]]) continue;
refNode = refNode.childNodes[route[i]];
}
return {refNode, refParentNode};