BUGFIX choice default is not mandatory
diff --git a/src/netopeerguid.c b/src/netopeerguid.c
index 34f6b35..62766ca 100644
--- a/src/netopeerguid.c
+++ b/src/netopeerguid.c
@@ -812,7 +812,9 @@
     node_metadata_basic((struct lys_node *)choice, parent);
 
     /* default */
-    node_metadata_text(choice->dflt->name, "default", parent);
+    if (choice->dflt) {
+        node_metadata_text(choice->dflt->name, "default", parent);
+    }
 
     /* when */
     node_metadata_when(choice->when, parent);