Fix segfault on login caused by 53397bf970
newAvatarUrl() returns an Omittable<QUrl> instead of a QUrl that may be empty. When the Omittable is empty, dereferencing it returns a nullptr and calling something on that segfaults
This commit is contained in:
@@ -305,7 +305,7 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
||||
if (e.isAvatarUpdate()) {
|
||||
if (!text.isEmpty())
|
||||
text += " and ";
|
||||
if (e.newAvatarUrl()->isEmpty())
|
||||
if (!e.newAvatarUrl())
|
||||
text += tr("cleared their avatar");
|
||||
else if (e.prevContent()->avatarUrl->isEmpty())
|
||||
text += tr("set an avatar");
|
||||
|
||||
Reference in New Issue
Block a user