From 8f5fbb4053f29db97cbf1006d821b12f59c04223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Dezeiraud?= Date: Sat, 16 Nov 2024 19:51:52 +0100 Subject: [PATCH] Update FluChart.qml In some cases, not sure why but animateToNewData is called and jsChart is undefined so it generate an error. Adding a "?" operator avoid the issue if jsChart is not ready, no error and can be called later. --- src/Qt5/imports/FluentUI/Controls/FluChart.qml | 2 +- src/Qt6/imports/FluentUI/Controls/FluChart.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Qt5/imports/FluentUI/Controls/FluChart.qml b/src/Qt5/imports/FluentUI/Controls/FluChart.qml index 4b1f77ab..f47bd20d 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluChart.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluChart.qml @@ -15,7 +15,7 @@ Canvas { function animateToNewData() { chartAnimationProgress = 0.1; - d.jsChart.update(); + d.jsChart?.update(); chartAnimator.restart(); } QtObject{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluChart.qml b/src/Qt6/imports/FluentUI/Controls/FluChart.qml index ebc70b15..30af5ab3 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluChart.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluChart.qml @@ -14,7 +14,7 @@ Canvas { function animateToNewData() { chartAnimationProgress = 0.1; - d.jsChart.update(); + d.jsChart?.update(); chartAnimator.restart(); } QtObject{