1 files changed, 2 insertions, 1 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp
index 2c4f6186..994a3a67 100644
--- a/src/Olm.cpp
+++ b/src/Olm.cpp
@@ -168,7 +168,8 @@ encrypt_group_message(const std::string &room_id, const std::string &device_id,
// relations shouldn't be encrypted...
mtx::common::ReplyRelatesTo relation;
- if (body["content"]["m.relates_to"].contains("m.in_reply_to")) {
+ if (body["content"].contains("m.relates_to") &&
+ body["content"]["m.relates_to"].contains("m.in_reply_to")) {
relation = body["content"]["m.relates_to"];
body["content"].erase("m.relates_to");
}
|