xpath BUGFIX check ht for existence before duplicating

Refs #1393
diff --git a/src/xpath.c b/src/xpath.c
index 9dc8d24..69ec47c 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -804,7 +804,9 @@
         ret->used = ret->size = set->used;
         ret->ctx_pos = set->ctx_pos;
         ret->ctx_size = set->ctx_size;
-        ret->ht = lyht_dup(set->ht);
+        if (set->ht) {
+            ret->ht = lyht_dup(set->ht);
+        }
     } else {
         memcpy(ret, set, sizeof *ret);
         if (set->type == LYXP_SET_STRING) {