Fix crash in avatar url handling

This commit is contained in:
Tobias Fella
2023-05-01 11:49:35 +02:00
parent 7156bf0711
commit 8e4da42a64

View File

@@ -1921,7 +1921,11 @@ QByteArray NeoChatRoom::roomAcountDataJson(const QString &eventType)
QUrl NeoChatRoom::avatarForMember(NeoChatUser *user) const
{
#ifdef QUOTIENT_07
auto avatar = connection()->makeMediaUrl(memberAvatarUrl(user->id()));
const auto &url = memberAvatarUrl(user->id());
if (url.isEmpty()) {
return {};
}
auto avatar = connection()->makeMediaUrl(url);
if (avatar.isValid() && avatar.scheme() == QStringLiteral("mxc")) {
return avatar;
} else {