Skip to content

Commit 1595ebc

Browse files
Merge pull request #270 from philwo/fix-unused-result
unotify: check return value of TextFormat::PrintToString
2 parents 5674c62 + 7e4a6fb commit 1595ebc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

unotify/stats.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ void printStats(nsj_t* nsj) {
170170
}
171171

172172
std::string text_report;
173-
google::protobuf::TextFormat::PrintToString(report_pb, &text_report);
173+
if (!google::protobuf::TextFormat::PrintToString(report_pb, &text_report)) {
174+
LOG_W("Failed to format unotify report");
175+
return;
176+
}
174177

175178
LOG_I("unotify report:\n%s", text_report.c_str());
176179

0 commit comments

Comments
 (0)