From 7cb0dc4d2b16691cfceea77d7ef3c33e85f7a569 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 8 Apr 2021 07:38:14 +0200 Subject: [PATCH] fix: Missing null check --- lib/utils/background_push.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 0c888e44..25d2e0bb 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -576,11 +576,11 @@ class BackgroundPush { Future _showNotification(String roomId, String eventId) async { await setupLocalNotificationsPlugin(); final room = client.getRoomById(roomId); - await room.postLoad(); - final event = await client.database.getEventById(client.id, eventId, room); if (room == null) { throw 'Room not found'; } + await room.postLoad(); + final event = await client.database.getEventById(client.id, eventId, room); if (((client.activeRoomId?.isNotEmpty ?? false) && client.activeRoomId == room.id &&