diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 515b3ec4..bd7230b6 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -148,6 +148,7 @@ class ChatController extends State { return; } setReadMarker(); + if (!scrollController.hasClients) return; if (scrollController.position.pixels == scrollController.position.maxScrollExtent && timeline!.events.isNotEmpty && diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 3347f176..0e465896 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -289,13 +289,13 @@ class BackgroundPush { Future goToRoom(String? roomId) async { try { Logs().v('[Push] Attempting to go to room $roomId...'); - if (router == null) { + if (router == null || roomId == null) { return; } await client.roomsLoading; await client.accountDataLoading; final isStory = client - .getRoomById(roomId!) + .getRoomById(roomId) ?.getState(EventTypes.RoomCreate) ?.content .tryGet('type') ==