Skip to content

Commit c3305ab

Browse files
schema: fix empty compiled shema in iter_children
A module schema can have no compiled schema. In this case, lys_getnext returns an error (module and parent being NULL), leading to this log "Invalid argument parent || module || ext (lys_getnext_()).". Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
1 parent e602016 commit c3305ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libyang/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,8 @@ def _skip(node) -> bool:
16471647
return False
16481648

16491649
if ffi.typeof(parent) == ffi.typeof("struct lys_module *"):
1650+
if parent.compiled == ffi.NULL:
1651+
return
16501652
module = parent.compiled
16511653
parent = ffi.NULL
16521654
else:

0 commit comments

Comments
 (0)