fix crash when open invitation page
This commit is contained in:
@@ -105,6 +105,12 @@ QVariant UserListModel::data(const QModelIndex &index, int role) const
|
|||||||
#else
|
#else
|
||||||
auto pl = m_currentRoom->getCurrentState<RoomPowerLevelsEvent>();
|
auto pl = m_currentRoom->getCurrentState<RoomPowerLevelsEvent>();
|
||||||
#endif
|
#endif
|
||||||
|
// User might not in the room yet, in this case pl can be nullptr.
|
||||||
|
// e.g. When invited but user not accepted or denied the invitation.
|
||||||
|
if (!pl) {
|
||||||
|
return QStringLiteral("Not Available");
|
||||||
|
}
|
||||||
|
|
||||||
auto userPl = pl->powerLevelForUser(user->id());
|
auto userPl = pl->powerLevelForUser(user->id());
|
||||||
|
|
||||||
switch (userPl) {
|
switch (userPl) {
|
||||||
|
|||||||
Reference in New Issue
Block a user