Avoid assert check when switching to main profile

This can happen if the user doesn't have an avatar set, as there's an
assert check inside of makeMediaUrl. We can avoid this by checking if
the string is empty before calling that.
This commit is contained in:
Joshua Goins
2026-01-07 15:46:18 -05:00
parent aa0272a02d
commit 5e473aae0a

View File

@@ -68,7 +68,14 @@ Kirigami.Dialog {
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
name: root.room ? root.room.member(root.user.id).displayName : root.user.displayName
source: root.room ? root.room.member(root.user.id).avatarUrl : root.connection.makeMediaUrl(root.user.avatarUrl)
source: {
if (root.room) {
return root.room.member(root.user.id).avatarUrl;
} else if(root.user.avatarUrl.toString() !== '') {
return root.connection.makeMediaUrl(root.user.avatarUrl);
}
return "";
}
color: root.room ? root.room.member(root.user.id).color : QmlUtils.getUserColor(root.user.hueF)
}