Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkotila authored and debermudez committed Mar 12, 2024
1 parent e7c80db commit 5546fbc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/c++/perf_analyzer/profile_data_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@ ProfileDataExporter::AddResponseOutputs(
const auto& byte_size{output.second.second};
rapidjson::Value name_json(name.c_str(), document_.GetAllocator());
rapidjson::Value output_json{};
output_json.SetString(
reinterpret_cast<const char*>(buf), byte_size,
document_.GetAllocator());
if (buf != nullptr) {
output_json.SetString(
reinterpret_cast<const char*>(buf), byte_size,
document_.GetAllocator());
} else {
output_json.SetString("", 0, document_.GetAllocator());
}
response_output_json.AddMember(
name_json, output_json, document_.GetAllocator());
}
Expand Down

0 comments on commit 5546fbc

Please sign in to comment.