Fix undefined access when loading stickers in chat

We need a check here, because stickers (and really, any images without a
tempSource) will try to access an undefined object.

This fixes the error:
"qrc:/qt/qml/org/kde/neochat/timeline/ImageComponent.qml:106: TypeError: Cannot read property 'source' of undefined"

(cherry picked from commit 2a8cd74ab1)
This commit is contained in:
Joshua Goins
2024-11-16 16:25:32 -05:00
parent cfd06d064c
commit da0f6f78a4

View File

@@ -103,7 +103,7 @@ Item {
Image {
anchors.fill: parent
source: visible ? (root?.mediaInfo.tempInfo.source ?? "") : ""
source: visible ? (root?.mediaInfo.tempInfo?.source ?? "") : ""
visible: _private.imageItem && _private.imageItem.status !== Image.Ready && !_private.hideImage
}