Fix crash for forbidden non-mxc media
BUG: 476698
This commit is contained in:
@@ -944,12 +944,12 @@ QVariantMap MessageEventModel::getMediaInfoFromFileInfo(const EventContent::File
|
||||
QVariantMap mediaInfo;
|
||||
|
||||
// Get the mxc URL for the media.
|
||||
if (!fileInfo->url().isValid() || eventId.isEmpty()) {
|
||||
if (!fileInfo->url().isValid() || fileInfo->url().scheme() != QStringLiteral("mxc") || eventId.isEmpty()) {
|
||||
mediaInfo["source"] = QUrl();
|
||||
} else {
|
||||
QUrl source = m_currentRoom->makeMediaUrl(eventId, fileInfo->url());
|
||||
|
||||
if (source.isValid() && source.scheme() == QStringLiteral("mxc")) {
|
||||
if (source.isValid()) {
|
||||
mediaInfo["source"] = source;
|
||||
} else {
|
||||
mediaInfo["source"] = QUrl();
|
||||
|
||||
Reference in New Issue
Block a user