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()) {