From 211c36666283e9dc48f551f909781c5f2fbc06d3 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 30 Jun 2022 15:33:20 +0200 Subject: [PATCH] refactor: Use tryGet in handleRoomEvents --- lib/src/client.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }