From c96c9c4038ad3940ff7844fdbe07dc1bd19e0b4c Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:57:13 +1100 Subject: [PATCH] fix: dash currentItem null ref --- modules/dashboard/Content.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/dashboard/Content.qml b/modules/dashboard/Content.qml index 34e4f77a..fba608fe 100644 --- a/modules/dashboard/Content.qml +++ b/modules/dashboard/Content.qml @@ -99,15 +99,15 @@ Item { flickableDirection: Flickable.HorizontalFlick - implicitWidth: currentItem.implicitWidth - implicitHeight: currentItem.implicitHeight + implicitWidth: currentItem?.implicitWidth ?? 0 + implicitHeight: currentItem?.implicitHeight ?? 0 - contentX: currentItem.x + contentX: currentItem?.x ?? 0 contentWidth: row.implicitWidth contentHeight: row.implicitHeight onContentXChanged: { - if (!moving) + if (!moving || !currentItem) return; const x = contentX - currentItem.x; @@ -118,13 +118,16 @@ Item { } onDragEnded: { + if (!currentItem) + return; + const x = contentX - currentItem.x; if (x > currentItem.implicitWidth / 10) root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1); else if (x < -currentItem.implicitWidth / 10) root.state.currentTab = Math.max(root.state.currentTab - 1, 0); else - contentX = Qt.binding(() => currentItem.x); + contentX = Qt.binding(() => currentItem?.x ?? 0); } RowLayout {