xpath BUGFIX traverse only implemented modules
diff --git a/src/xpath.c b/src/xpath.c
index b98197f..72e3aa0 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -5521,7 +5521,8 @@
mod_idx = 0;
while (moveto_mod || (moveto_mod = (struct lys_module *)ly_ctx_get_module_iter(set->ctx, &mod_idx))) {
sub = NULL;
- while ((sub = lys_getnext(sub, NULL, moveto_mod->compiled, getnext_opts))) {
+ /* module may not be implemented */
+ while (moveto_mod->implemented && (sub = lys_getnext(sub, NULL, moveto_mod->compiled, getnext_opts))) {
if (!moveto_scnode_check(sub, set->root_type, name_dict, moveto_mod)) {
idx = lyxp_set_scnode_insert_node(set, sub, LYXP_NODE_ELEM);
/* we need to prevent these nodes from being considered in this moveto */