From 482a6827018934d66d2be3b02c0e44aedb193118 Mon Sep 17 00:00:00 2001 From: Michal Vasko Date: Fri, 6 May 2022 08:56:12 +0200 Subject: [PATCH] xpath BUGFIX opaque nodes have no XPath position Fixes #1841 --- src/xpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xpath.c b/src/xpath.c index 37d1021f1..8681a85e5 100644 --- a/src/xpath.c +++ b/src/xpath.c @@ -1360,7 +1360,7 @@ get_node_pos(const struct lyd_node *node, enum lyxp_node_type node_type, const s LYD_TREE_DFS_continue = 0; } - if ((root_type == LYXP_NODE_ROOT_CONFIG) && (elem->schema->flags & LYS_CONFIG_R)) { + if (!elem->schema || ((root_type == LYXP_NODE_ROOT_CONFIG) && (elem->schema->flags & LYS_CONFIG_R))) { /* skip */ LYD_TREE_DFS_continue = 1; } else {