]> git.cworth.org Git - apitrace/commitdiff
Handle null strings in json writer.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 11 Oct 2011 18:33:02 +0000 (19:33 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 11 Oct 2011 19:29:34 +0000 (20:29 +0100)
common/json.hpp

index 9e6b96004dc71be9dc96e85a6d4279f508c12765..621610af4451c0720c796ee0c366d8fe2b91deb3 100644 (file)
@@ -270,6 +270,11 @@ public:
     }
 
     inline void writeString(const char *s) {
+        if (!s) {
+            writeNull();
+            return;
+        }
+
         separator();
         escapeUnicodeString(s);
         value = true;