aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mxcreply.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mxcreply.cpp b/lib/mxcreply.cpp
index c7547be8..ce833b98 100644
--- a/lib/mxcreply.cpp
+++ b/lib/mxcreply.cpp
@@ -63,10 +63,11 @@ MxcReply::MxcReply(QNetworkReply* reply, Room* room, const QString &eventId)
#ifdef Quotient_E2EE_ENABLED
auto eventIt = room->findInTimeline(eventId);
if(eventIt != room->historyEdge()) {
- auto event = eventIt->viewAs<RoomMessageEvent>();
- if (auto* efm = std::get_if<EncryptedFileMetadata>(
- &event->content()->fileInfo()->source))
- d->m_encryptedFile = *efm;
+ if (auto event = eventIt->viewAs<RoomMessageEvent>()) {
+ if (auto* efm = std::get_if<EncryptedFileMetadata>(
+ &event->content()->fileInfo()->source))
+ d->m_encryptedFile = *efm;
+ }
}
#endif
}