From fdaeccbf70e5e465dd1b6737ab7d6da4d475ebf3 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sun, 20 Mar 2022 15:46:03 +0100 Subject: [PATCH] fix: Open room from notification click produces errors --- lib/pages/chat/chat.dart | 1 + lib/utils/background_push.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 515b3ec45..bd7230b63 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 3347f1767..0e465896d 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') ==