fix: Do not return invalid state events from database

This commit is contained in:
HuangRed 2024-06-11 09:28:49 +08:00 committed by Nicolas Werner
parent 5d583e5808
commit e65d7f94ca
No known key found for this signature in database
GPG Key ID: B38119FF80087618
2 changed files with 2 additions and 2 deletions

View File

@ -700,7 +700,7 @@ class HiveCollectionsDatabase extends DatabaseApi {
unimportantEvents.addAll(
states.values.map((raw) => Event.fromJson(copyMap(raw), room)));
}
return unimportantEvents;
return unimportantEvents.where((event) => event.stateKey != null).toList();
}
@override

View File

@ -692,7 +692,7 @@ class FamedlySdkHiveDatabase extends DatabaseApi with ZoneTransactionMixin {
unimportantEvents.addAll(
states.values.map((raw) => Event.fromJson(convertToJson(raw), room)));
}
return unimportantEvents;
return unimportantEvents.where((event) => event.stateKey != null).toList();
}
@override