add null check in room chat controller
This commit is contained in:
parent
85dc5b1a4d
commit
5cc4741e4b
1 changed files with 1 additions and 2 deletions
|
|
@ -24,9 +24,8 @@ class RoomChatController extends AsyncNotifier<IList<Event>> {
|
|||
final room = ref.watch(
|
||||
RoomsController.provider.select((rooms) => rooms[roomId]),
|
||||
);
|
||||
if (room == null) return .new();
|
||||
|
||||
if (!room.hasFetchedState) {
|
||||
if (!room!.hasFetchedState) {
|
||||
final state = await client.getRoomState(.new(roomId: roomId));
|
||||
|
||||
await ref.read(RoomsController.provider.notifier).addState(roomId, state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue