fix other logs page crash (#5458)

This commit is contained in:
Tayou 2026-05-04 16:03:09 +00:00 committed by GitHub
commit c4eb008d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -277,12 +277,15 @@ void OtherLogsPage::reload()
MessageLevel last = MessageLevel::Unknown;
auto handleLine = [this, &last](QString line) {
if (line.isEmpty())
if (!line.isEmpty() && line.back() == '\n') {
line.resize(line.size() - 1);
}
if (!line.isEmpty() && line.back() == '\r') {
line.resize(line.size() - 1);
}
if (line.isEmpty()) {
return false;
if (line.back() == '\n')
line.resize(line.size() - 1);
if (line.back() == '\r')
line.resize(line.size() - 1);
}
MessageLevel level = MessageLevel::Unknown;
QString lineTemp = line; // don't edit out the time and level for clarity