Make sure that content is kept alive so fileInfo can be used throughout the function

This commit is contained in:
James Graham
2024-10-15 16:54:19 +01:00
parent 365af2cd6c
commit 79deda4f2d

View File

@@ -704,7 +704,8 @@ QVariantMap EventHandler::getMediaInfoForEvent(const NeoChatRoom *room, const Qu
}
const EventContent::FileInfo *fileInfo;
fileInfo = roomMessageEvent->content()->fileInfo();
const auto content = roomMessageEvent->content();
fileInfo = content->fileInfo();
QVariantMap mediaInfo = getMediaInfoFromFileInfo(room, fileInfo, eventId, false, false);
// if filename isn't specifically given, it is in body
// https://spec.matrix.org/latest/client-server-api/#mfile