fix compiling on arch

This commit is contained in:
ebbit1q 2026-04-02 20:18:01 +02:00
parent ba786a0289
commit 3cf3fa789d
7 changed files with 108 additions and 56 deletions

View file

@ -101,6 +101,10 @@ QString getSafeDebugString(const ::google::protobuf::Message &message)
#endif // GOOGLE_PROTOBUF_VERSION > 3004000
std::string debug_string;
printer.PrintToString(message, &debug_string);
return QString::number(size) + " bytes " + QString::fromStdString(debug_string);
bool ok = printer.PrintToString(message, &debug_string);
if (ok) {
return QString::number(size) + " bytes " + QString::fromStdString(debug_string);
} else {
return "could not convert message to string";
}
}