From 451bc27edb1502edf1482d4ffeee651cddbb7257 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Thu, 27 Oct 2016 10:52:50 +0200 Subject: [PATCH] json: write null when const char* = 0 Signed-off-by: Sergey Linev --- io/io/src/TBufferJSON.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/io/io/src/TBufferJSON.cxx b/io/io/src/TBufferJSON.cxx index 81753f8554c71..ac41236cc931d 100644 --- a/io/io/src/TBufferJSON.cxx +++ b/io/io/src/TBufferJSON.cxx @@ -3047,9 +3047,14 @@ void TBufferJSON::JsonWriteBasic(ULong64_t value) void TBufferJSON::JsonWriteConstChar(const char* value, Int_t len) { - fValue.Append("\""); + if (value==0) { + + fValue.Append("null"); + + } else { + + fValue.Append("\""); - if (value!=0) { if (len<0) len = strlen(value); for (Int_t n=0;n