Don't crash when creating a DM
This commit is contained in:
@@ -720,8 +720,11 @@ void Controller::openOrCreateDirectChat(NeoChatUser *user)
|
|||||||
const auto existing = activeConnection()->directChats();
|
const auto existing = activeConnection()->directChats();
|
||||||
|
|
||||||
if (existing.contains(user)) {
|
if (existing.contains(user)) {
|
||||||
RoomManager::instance().enterRoom(static_cast<NeoChatRoom *>(activeConnection()->room(existing.value(user))));
|
const auto &room = static_cast<NeoChatRoom *>(activeConnection()->room(existing.value(user)));
|
||||||
return;
|
if (room) {
|
||||||
|
RoomManager::instance().enterRoom(room);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
activeConnection()->requestDirectChat(user);
|
activeConnection()->requestDirectChat(user);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user