fix: Add missing null check

This commit is contained in:
Christian Pauly 2021-08-01 16:06:34 +02:00
parent d6728783a2
commit ac7ee03bd9

View File

@ -200,6 +200,7 @@ class ChatListController extends State<ChatList> {
return true; return true;
} }
if (room.isDirectChat && if (room.isDirectChat &&
room.summary?.mHeroes != null &&
room.summary.mHeroes.any((userId) { room.summary.mHeroes.any((userId) {
final user = space.getState(EventTypes.RoomMember, userId)?.asUser; final user = space.getState(EventTypes.RoomMember, userId)?.asUser;
return user != null && user.membership == Membership.join; return user != null && user.membership == Membership.join;