summaryrefslogtreecommitdiff
path: root/samples/sample_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samples/sample_text.cpp')
-rw-r--r--samples/sample_text.cpp5
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());