diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml index 4adff572..076e84c0 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml @@ -49,6 +49,12 @@ Rectangle { } + MouseArea { + id: mouseArea + + anchors.fill: parent + onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id) + } } Rectangle { diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index d0356e15..03eb53fc 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -363,6 +363,9 @@ TimelineViewManager::toggleCameraView() void TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const { + if (mxcUrl.isEmpty()) { + return; + } QQuickImageResponse *imgResponse = imgProvider->requestImageResponse(mxcUrl.remove("mxc://"), QSize()); connect(imgResponse, &QQuickImageResponse::finished, this, [this, eventId, imgResponse]() {