From 335ef240f54e306176f30eccab3da88589c5631d Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 7 Feb 2022 15:35:45 +0100 Subject: [PATCH] Don't crash on empty creation event --- src/roomlistmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/roomlistmodel.cpp b/src/roomlistmodel.cpp index b441be5bc..85bba262f 100644 --- a/src/roomlistmodel.cpp +++ b/src/roomlistmodel.cpp @@ -354,6 +354,9 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const return NeoChatRoomType::Direct; } const RoomCreateEvent *creationEvent = room->creation(); + if (!creationEvent) { + return NeoChatRoomType::Normal; + } QJsonObject contentJson = creationEvent->contentJson(); QJsonObject::const_iterator typeIter = contentJson.find("type"); if (typeIter != contentJson.end()) {