fix: Guard against a crash in the critical section

This commit is contained in:
PapaTutuWawa 2022-09-15 23:33:07 +02:00
parent b69acdd936
commit b4c14a9769

View File

@ -415,7 +415,7 @@ class OmemoSessionManager {
await _lock.synchronized(() async { await _lock.synchronized(() async {
// Get devices for jid // Get devices for jid
final devices = _deviceMap[jid]!; final devices = _deviceMap[jid] ?? [];
for (final deviceId in devices) { for (final deviceId in devices) {
final ratchet = _ratchetMap[RatchetMapKey(jid, deviceId)]!; final ratchet = _ratchetMap[RatchetMapKey(jid, deviceId)]!;