aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/connection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 4a220e0d..60ffed09 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -798,8 +798,13 @@ void Connection::Private::consumeToDeviceEvents(Events&& toDeviceEvents)
qCDebug(E2EE) << "Unsupported algorithm" << event.id() << "for event" << event.algorithm();
return;
}
+ const auto decryptedEvent = sessionDecryptMessage(event);
+ if(!decryptedEvent) {
+ qCWarning(E2EE) << "Failed to decrypt event" << event.id();
+ return;
+ }
- visit(*sessionDecryptMessage(event),
+ visit(*decryptedEvent,
[this, senderKey = event.senderKey()](const RoomKeyEvent& roomKeyEvent) {
if (auto* detectedRoom = q->room(roomKeyEvent.roomId())) {
detectedRoom->handleRoomKeyEvent(roomKeyEvent, senderKey);