tests FEATURE more advanced tests of hash_table.c functions
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 0c55a7c..a80a62c 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -1067,10 +1067,12 @@
     ret = get_string(ctx, data, Y_MAYBE_STR_ARG, &word, &buf, &word_len);
     LY_CHECK_RET(ret);
 
-    if (buf) {
-        stmt->arg = lydict_insert_zc(ctx, word);
-    } else {
-        stmt->arg = lydict_insert(ctx, word, word_len);
+    if (word) {
+        if (buf) {
+            stmt->arg = lydict_insert_zc(ctx, word);
+        } else {
+            stmt->arg = lydict_insert(ctx, word, word_len);
+        }
     }
 
     /* insert into parent statements */
@@ -1126,10 +1128,12 @@
     ret = get_string(ctx, data, Y_MAYBE_STR_ARG, &word, &buf, &word_len);
     LY_CHECK_RET(ret);
 
-    if (buf) {
-        e->argument = lydict_insert_zc(ctx, word);
-    } else {
-        e->argument = lydict_insert(ctx, word, word_len);
+    if (word) {
+        if (buf) {
+            e->argument = lydict_insert_zc(ctx, word);
+        } else {
+            e->argument = lydict_insert(ctx, word, word_len);
+        }
     }
 
     YANG_READ_SUBSTMT_FOR(ctx, data, kw, word, word_len, ret) {