mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Fix crash on redactions without because
This commit is contained in:
parent
0d43eb1e11
commit
b505fa42d5
1 changed files with 5 additions and 3 deletions
|
@ -1814,11 +1814,13 @@ TimelineModel::formatRedactedEvent(QString id)
|
||||||
QString reason = "";
|
QString reason = "";
|
||||||
auto because = event->unsigned_data.redacted_because;
|
auto because = event->unsigned_data.redacted_because;
|
||||||
// User info about who actually sent the redacted event.
|
// User info about who actually sent the redacted event.
|
||||||
QString redactedUser = QString::fromStdString(because->sender).toHtmlEscaped();
|
QString redactedUser;
|
||||||
QString redactedName = utils::replaceEmoji(displayName(redactedUser));
|
QString redactedName;
|
||||||
|
|
||||||
if (because.has_value()) {
|
if (because.has_value()) {
|
||||||
reason = QString::fromStdString(because->content.reason).toHtmlEscaped();
|
redactedUser = QString::fromStdString(because->sender).toHtmlEscaped();
|
||||||
|
redactedName = utils::replaceEmoji(displayName(redactedUser));
|
||||||
|
reason = QString::fromStdString(because->content.reason).toHtmlEscaped();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason.isEmpty()) {
|
if (reason.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue