summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-29 14:55:17 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-29 14:55:40 +0100
commitb505fa42d506c928f362889bcf3996df08314809 (patch)
treeb9a4f7beb90b5d2c93542a9fcaa48e45b723fd0c /src
parentTranslated using Weblate (English) (diff)
downloadnheko-b505fa42d506c928f362889bcf3996df08314809.tar.xz
Fix crash on redactions without because
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineModel.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 79d6883f..5a5f4850 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -1814,11 +1814,13 @@ TimelineModel::formatRedactedEvent(QString id) QString reason = ""; auto because = event->unsigned_data.redacted_because; // User info about who actually sent the redacted event. - QString redactedUser = QString::fromStdString(because->sender).toHtmlEscaped(); - QString redactedName = utils::replaceEmoji(displayName(redactedUser)); + QString redactedUser; + QString redactedName; 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()) {