Skip to content

Commit 5c1d4c2

Browse files
committed
tree data BUGFIX inserting nodes before opaq nodes
1 parent f933e66 commit 5c1d4c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tree_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ lyd_insert_node(struct lyd_node *parent, struct lyd_node **first_sibling_p, stru
672672
anchor = lyd_insert_get_next_anchor(first_sibling, node);
673673

674674
/* cannot insert data node after opaque nodes */
675-
if (node->schema && first_sibling && !first_sibling->prev->schema) {
675+
if (!anchor && node->schema && first_sibling && !first_sibling->prev->schema) {
676676
anchor = first_sibling->prev;
677677
while ((anchor != first_sibling) && !anchor->prev->schema) {
678678
anchor = anchor->prev;

0 commit comments

Comments
 (0)