parser json BUGFIX added condition for opaq node
diff --git a/src/validation.c b/src/validation.c
index 8a05adc..b9eda81 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -1372,7 +1372,7 @@
LY_CHECK_RET(lyd_validate_final_r(lyd_child(node), node, node->schema, NULL, val_opts, int_opts));
/* set default for containers */
- if ((node->schema->nodetype == LYS_CONTAINER) && !(node->schema->flags & LYS_PRESENCE)) {
+ if (node->schema && (node->schema->nodetype == LYS_CONTAINER) && !(node->schema->flags & LYS_PRESENCE)) {
LY_LIST_FOR(lyd_child(node), next) {
if (!(next->flags & LYD_DEFAULT)) {
break;