tree data MEAINTENANCE safety assert for parent to be inner node
diff --git a/src/tree_data.c b/src/tree_data.c
index 19b3f06..cbfce2a 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1819,6 +1819,8 @@
 
     /* inserting list without its keys is not supported */
     assert((parent || first_sibling_p) && node && (node->hash || !node->schema));
+    assert(!parent || !parent->schema ||
+            (parent->schema->nodetype & (LYS_CONTAINER | LYS_LIST | LYS_RPC | LYS_ACTION | LYS_NOTIF)));
 
     if (!parent && first_sibling_p && (*first_sibling_p) && (*first_sibling_p)->parent) {
         parent = (struct lyd_node *)(*first_sibling_p)->parent;