1 files changed, 4 insertions, 0 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp
index 60460b5c..14c97984 100644
--- a/src/Olm.cpp
+++ b/src/Olm.cpp
@@ -1129,6 +1129,10 @@ decryptEvent(const MegolmSessionIndex &index,
std::string msg_str;
try {
auto session = cache::client()->getInboundMegolmSession(index);
+ if (!session) {
+ return {DecryptionErrorCode::MissingSession, std::nullopt, std::nullopt};
+ }
+
auto sessionData =
cache::client()->getMegolmSessionData(index).value_or(GroupSessionData{});
|