From d9f0ec8adaf99d674e315674d2b8e977a3435ec8 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 11 Nov 2020 15:23:33 +0100 Subject: [PATCH] Fix segfault on login caused by 53397bf9701f84a0a3a60c0c876694c9e9631e4e newAvatarUrl() returns an Omittable instead of a QUrl that may be empty. When the Omittable is empty, dereferencing it returns a nullptr and calling something on that segfaults --- src/neochatroom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 6cbd9595c..aa4b5e8b6 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -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");