From da0f6f78a43e0f3dc5a6c1f3d9d407c20f6c666f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 16 Nov 2024 16:25:32 -0500 Subject: [PATCH] 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 2a8cd74ab159d9925b4c5c5098c2c3a7c1be2eca) --- src/timeline/ImageComponent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeline/ImageComponent.qml b/src/timeline/ImageComponent.qml index 3cc90b012..315db207b 100644 --- a/src/timeline/ImageComponent.qml +++ b/src/timeline/ImageComponent.qml @@ -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 }