diff --git a/lib/src/client.dart b/lib/src/client.dart index e007ddb0..cc79c50c 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1793,8 +1793,11 @@ class Client extends MatrixApi { // man-in-the-middle attacks! if ((event.type == EventTypes.Encryption && room.encrypted && - event.content['algorithm'] != - room.getState(EventTypes.Encryption)?.content['algorithm'])) { + event.content.tryGet('algorithm') != + room + .getState(EventTypes.Encryption) + ?.content + .tryGet('algorithm'))) { return; }