From 50564985ccfd686dde6f74050c1c3890246bd141 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 27 Jan 2021 21:30:06 +0100 Subject: [PATCH] Fix crash, when keys for no events were requested --- src/timeline/EventStore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index 4748f9c0..be4bc09e 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -246,7 +246,8 @@ EventStore::receivedSessionKey(const std::string &session_id) // Don't request keys again until Nheko is restarted (for now) pending_key_requests[session_id].events.clear(); - olm::send_key_request_for(request.events.front(), request.request_id, true); + if (!request.events.empty()) + olm::send_key_request_for(request.events.front(), request.request_id, true); for (const auto &e : request.events) { auto idx = idToIndex(e.event_id);