BUGFIX cannot traverse children of nodes without children
diff --git a/src/netopeerguid.c b/src/netopeerguid.c
index 62766ca..68e4fef 100644
--- a/src/netopeerguid.c
+++ b/src/netopeerguid.c
@@ -1958,8 +1958,10 @@
     }
 
 children:
-    LY_TREE_FOR(node->child, child) {
-        node_add_children_with_metadata_recursive(child, cur_module, node_json);
+    if (!(node->nodetype & (LYS_LEAF | LYS_LEAFLIST | LYS_ANYXML))) {
+        LY_TREE_FOR(node->child, child) {
+            node_add_children_with_metadata_recursive(child, cur_module, node_json);
+        }
     }
 }