diff options
Diffstat (limited to 'samples/sample_text.cpp')
-rw-r--r-- | samples/sample_text.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/sample_text.cpp b/samples/sample_text.cpp index 557077d4..d851120d 100644 --- a/samples/sample_text.cpp +++ b/samples/sample_text.cpp @@ -46,7 +46,10 @@ int main(int /*argc*/, const char * /*argv*/[]) { // to ensure it is correct, we now generate text back from the binary, // and compare the two: std::string jsongen; - GenerateText(parser, parser.builder_.GetBufferPointer(), &jsongen); + if (!GenerateText(parser, parser.builder_.GetBufferPointer(), &jsongen)) { + printf("Couldn't serialize parsed data to JSON!\n"); + return 1; + } if (jsongen != jsonfile) { printf("%s----------------\n%s", jsongen.c_str(), jsonfile.c_str()); |