validation BUGFIX non-compatible structs
diff --git a/src/validation.c b/src/validation.c
index 76d87eb..6760c13 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -849,6 +849,7 @@
 {
     const struct lysc_node *snode = NULL;
     struct lysc_node_list *slist;
+    struct lysc_node_leaflist *sllist;
     int getnext_opts;
 
     getnext_opts = LYS_GETNEXT_WITHCHOICE | LYS_GETNEXT_WITHCASE | (op == LYD_VALIDATE_OP_REPLY ? LYS_GETNEXT_OUTPUT : 0);
@@ -860,11 +861,16 @@
         }
 
         /* check min-elements and max-elements */
-        if (snode->nodetype & (LYS_LIST | LYS_LEAFLIST)) {
+        if (snode->nodetype == LYS_LIST) {
             slist = (struct lysc_node_list *)snode;
             if (slist->min || slist->max) {
                 LY_CHECK_RET(lyd_validate_minmax(first, snode, slist->min, slist->max));
             }
+        } else if (snode->nodetype == LYS_LEAFLIST) {
+            sllist = (struct lysc_node_leaflist *)snode;
+            if (sllist->min || sllist->max) {
+                LY_CHECK_RET(lyd_validate_minmax(first, snode, sllist->min, sllist->max));
+            }
 
         /* check generic mandatory existence */
         } else if (snode->flags & LYS_MAND_TRUE) {