Skip to content

Commit

Permalink
JSON: check if document accepts writer.
Browse files Browse the repository at this point in the history
  • Loading branch information
scamille committed Apr 10, 2018
1 parent 525726a commit a666695
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/report/sc_report_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,11 @@ void print_json2_pretty( FILE* o, const sim_t& sim )
std::array<char, 1024000> buffer;
FileWriteStream b( o, buffer.data(), buffer.size() );
PrettyWriter<FileWriteStream> writer( b );
doc.Accept( writer );
auto accepted = doc.Accept( writer );
if ( !accepted )
{
throw std::runtime_error("JSON Writer did not accept document.");
}
}

void print_json_pretty( FILE* o, const sim_t& sim )
Expand Down

0 comments on commit a666695

Please sign in to comment.