]> git.notmuchmail.org Git - notmuch/blobdiff - sprinter-json.c
sprinters: bugfix when NULL passed for a string.
[notmuch] / sprinter-json.c
index c9b683530b08cb97d0d4689efe7d0a3fff1b5e84..0a077907cd83368c339c320968ef2b8a5e91f7d8 100644 (file)
@@ -118,6 +118,8 @@ json_string_len (struct sprinter *sp, const char *val, size_t len)
 static void
 json_string (struct sprinter *sp, const char *val)
 {
+    if (val == NULL)
+       val = "";
     json_string_len (sp, val, strlen (val));
 }