parser json BUGFIX invalid memory access
diff --git a/src/parser_json.c b/src/parser_json.c
index 5408279..e88f4c0 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -855,8 +855,8 @@
representation_error:
LOGVAL(ctx, LYVE_SYNTAX_JSON,
"The attribute(s) of %s \"%s\" is expected to be represented as JSON %s, but input data contains @%s/%s.",
- lys_nodetype2str(nodetype), node->schema ? node->schema->name : ((struct lyd_node_opaq *)node)->name.name,
- expected, lyjson_token2str(status), in_parent ? "" : "name");
+ lys_nodetype2str(nodetype), node ? LYD_NAME(node) : LYD_NAME(prev), expected, lyjson_token2str(status),
+ in_parent ? "" : "name");
ret = LY_EVALID;