fix(GODT-2596): fix bug when trying to generate Sentry report and there is not log.

This commit is contained in:
Xavier Michelon
2023-04-28 10:36:26 +02:00
parent 06f710a9b1
commit 38b13d710c

View File

@ -43,7 +43,12 @@ QString latestBridgeLogPath() {
if (logsDir.isEmpty()) { if (logsDir.isEmpty()) {
return QString(); return QString();
} }
QFileInfoList files = logsDir.entryInfoList({ "v*.log" }, QDir::Files); // could do sorting, but only by last modification time. we want to sort by creation time. QFileInfoList files = logsDir.entryInfoList({ "v*.log" }, QDir::Files); // could do sorting, but only by last modification time. we want to sort by creation time.
if (files.isEmpty()) {
return QString();
}
std::sort(files.begin(), files.end(), [](QFileInfo const &lhs, QFileInfo const &rhs) -> bool { std::sort(files.begin(), files.end(), [](QFileInfo const &lhs, QFileInfo const &rhs) -> bool {
return lhs.birthTime() < rhs.birthTime(); return lhs.birthTime() < rhs.birthTime();
}); });