Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
fix segfault in console code
Browse files Browse the repository at this point in the history
  • Loading branch information
maltejur committed Apr 18, 2023
1 parent 8f0a810 commit 7b6e8fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/discordpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,11 @@ void DiscordPage::javaScriptConsoleMessage(
ansi += "\033[" + cssAnsiColorMap[color] + "m";
}
}
qDebug(discordLog) << (ansi + lines[0].trimmed() + "\033[0m " +
lines[endOfStyles].trimmed())
.toUtf8()
.constData();
if (endOfStyles < lines.length())
qDebug(discordLog) << (ansi + lines[0].trimmed() + "\033[0m " +
lines[endOfStyles].trimmed())
.toUtf8()
.constData();
for (auto line : lines.mid(endOfStyles + 1)) {
qDebug(discordLog) << line.toUtf8().constData();
}
Expand Down

0 comments on commit 7b6e8fc

Please sign in to comment.