From de4e087363e800c8fdcd9160cafd55eed8a0766c Mon Sep 17 00:00:00 2001 From: Lemmy Date: Wed, 25 Mar 2026 16:19:15 -0400 Subject: [PATCH] fix(nimagerounded): avoid null shader texture when image disappear --- Widgets/NImageRounded.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Widgets/NImageRounded.qml b/Widgets/NImageRounded.qml index ae31ca58a..a33ffcfe7 100644 --- a/Widgets/NImageRounded.qml +++ b/Widgets/NImageRounded.qml @@ -62,11 +62,23 @@ Item { } } + // Fallback texture provider to avoid null source warnings + ShaderEffectSource { + id: _safeFallback + sourceItem: Rectangle { + width: 1 + height: 1 + color: "transparent" + } + visible: false + live: false + } + ShaderEffect { anchors.fill: parent anchors.margins: root.borderWidth visible: !root.showFallback && root.imageSource !== null && root.status === Image.Ready - property var source: root.imageSource + property var source: root.imageSource ?? _safeFallback property real itemWidth: width property real itemHeight: height property real sourceWidth: root.imageSource?.sourceSize.width ?? 0