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 {