schema parsers BUGFIX setting correct return error code
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 3b6bc19..adc84fc 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -914,6 +914,7 @@
         break;
     }
     LY_CHECK_GOTO(ret, error);
+    assert(submod);
 
     /* make sure that the newest revision is at position 0 */
     lysp_sort_revisions(submod->revs);