fix: Missing null check

This commit is contained in:
Christian Pauly 2021-04-08 07:38:14 +02:00
parent 4eb919b805
commit 7cb0dc4d2b

View File

@ -576,11 +576,11 @@ class BackgroundPush {
Future<void> _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 &&