]> git.cworth.org Git - apitrace/blobdiff - common/json.hpp
Handle null strings in json writer.
[apitrace] / 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;