Skip to content

Commit

Permalink
Fix child reassignment after Map
Browse files Browse the repository at this point in the history
This fixes a bug that was introduced in e6ce13f where the newChild was
checked and added to the child list but was not walked after being
mapped. This resulted in invalid handling of the child, since the walk
would then proceed incorrectly with the original child instead of its
replacement.

This in particular breaks things like include mappings that replace
a statement with a document (or collection of documents).
  • Loading branch information
nilium committed Oct 1, 2018
1 parent ce8e982 commit 4abdca1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func walkInContext(context, parent ParentNode, walker Walker) (err error) {
i--
continue
}
children[i] = newChild

child = newChild
children[i] = child
}

switch child := child.(type) {
Expand Down

0 comments on commit 4abdca1

Please sign in to comment.