Skip to content
Snippets Groups Projects
Unverified Commit e7d03449 authored by Loren Burkholder's avatar Loren Burkholder Committed by GitHub
Browse files

Fixed a crash in member list loading (#1199)

parent 33403d65
No related branches found
No related tags found
No related merge requests found
......@@ -40,14 +40,17 @@ MemberListBackend::MemberListBackend(const QString &room_id, QObject *parent)
void
MemberListBackend::addUsers(const std::vector<RoomMember> &members)
{
auto thisRoom = ChatPage::instance()->timelineManager()->rooms()->getRoomById(room_id_);
if (thisRoom.isNull()) {
nhlog::ui()->error("Could not load the current room");
return;
}
beginInsertRows(
QModelIndex{}, m_memberList.count(), m_memberList.count() + (int)members.size() - 1);
for (const auto &member : members)
m_memberList.push_back(
{member,
ChatPage::instance()->timelineManager()->rooms()->currentRoom()->avatarUrl(
member.user_id)});
m_memberList.push_back({member, thisRoom->avatarUrl(member.user_id)});
endInsertRows();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment