From ece3a60cfad87928342902021f94d0b1fd869801 Mon Sep 17 00:00:00 2001 From: Shrief Gabr Date: Tue, 16 Apr 2024 15:59:11 +0300 Subject: [PATCH] QmlDesigner: Prevent QDS crash during asset import in debug mode Task-number: QDS-12436 Change-Id: I5ecac614faff58a314ec2886730e4d69f717885b Reviewed-by: Miikka Heikkinen --- .../components/itemlibrary/itemlibraryassetimportdialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp index b8a75851f62..2c690726029 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp @@ -702,8 +702,10 @@ QGridLayout *ItemLibraryAssetImportDialog::createOptionsGrid( // and move the remaining member to ungrouped options // Note: <= 2 instead of < 2 because each group has group label member if (i != 0 && groupWidgets.size() <= 2) { - widgets[0].prepend(groupWidgets[1]); - groupWidgets[0].first->hide(); // hide group label + if (groupWidgets.size() == 2) + widgets[0].prepend(groupWidgets[1]); + if (groupWidgets.size() >= 1) + groupWidgets[0].first->hide(); // hide group label groupWidgets.clear(); } }