Handle null strings in json writer.
diff --git a/common/json.hpp b/common/json.hpp
index 9e6b960..621610a 100644
--- a/common/json.hpp
+++ b/common/json.hpp
@@ -270,6 +270,11 @@
     }
 
     inline void writeString(const char *s) {
+        if (!s) {
+            writeNull();
+            return;
+        }
+
         separator();
         escapeUnicodeString(s);
         value = true;