fix: missing null check
Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
This commit is contained in:
parent
368162c76b
commit
8058f88fe2
|
|
@ -21,6 +21,7 @@ import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:collection/collection.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
|
||||||
import 'package:matrix/encryption/utils/olm_session.dart';
|
import 'package:matrix/encryption/utils/olm_session.dart';
|
||||||
|
|
@ -358,7 +359,9 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
||||||
.toList();
|
.toList();
|
||||||
final rawEvents = await _eventsBox.getAll(keys);
|
final rawEvents = await _eventsBox.getAll(keys);
|
||||||
return rawEvents
|
return rawEvents
|
||||||
.map((rawEvent) => Event.fromJson(copyMap(rawEvent!), room))
|
.map((rawEvent) =>
|
||||||
|
rawEvent != null ? Event.fromJson(copyMap(rawEvent), room) : null)
|
||||||
|
.whereNotNull()
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue