Fix crash on name change events

This commit is contained in:
Tobias Fella
2021-01-27 01:23:35 +01:00
parent 8e6d1a8ea2
commit 4894470e7d

View File

@@ -389,7 +389,7 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
}
// Part 2: profile changes of joined members
if (e.isRename() && NeoChatConfig::self()->showRename()) {
if (e.newDisplayName().has_value()) {
if (!e.newDisplayName().has_value()) {
text = i18n("cleared their display name");
} else {
text = i18n("changed their display name to %1", e.newDisplayName()->toHtmlEscaped());