diff --git a/lib/src/client.dart b/lib/src/client.dart index 62841f7..6c2a03e 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1408,6 +1408,7 @@ class Client { _pendingToDeviceEvents.add(toDeviceEvent); break; } + room ??= Room(client: this, id: roomId); final String sessionId = toDeviceEvent.content['session_id']; if (toDeviceEvent.type == 'm.room_key' && userDeviceKeys.containsKey(toDeviceEvent.sender) &&