json parser BUGFIX invalid pointer dereference

Refs #1611
diff --git a/src/parser_json.c b/src/parser_json.c
index cf8e8df..01aaed8 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -900,7 +900,7 @@
     }
 
     /* create node */
-    lydjson_get_node_prefix(&parent->node, prefix, prefix_len, &module_name, &module_name_len);
+    lydjson_get_node_prefix(parent ? &parent->node : NULL, prefix, prefix_len, &module_name, &module_name_len);
     ret = lyd_create_opaq(lydctx->jsonctx->ctx, name, name_len, prefix, prefix_len, module_name, module_name_len, value,
             value_len, &dynamic, LY_VALUE_JSON, NULL, type_hint, node_p);
     if (dynamic) {