QmlDesigner: Add try/catch block

There seem to be rare cases in which this fails.

Change-Id: I229a9a72394ec25dca1a9cdae0b51aa36291be94
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2023-11-17 10:27:18 +01:00
parent 901b356ea5
commit 8932f9d462

View File

@@ -251,7 +251,11 @@ void ItemLibraryWidget::handleAddImport(int index)
imports.append(dependencyImport);
}
imports.append(import);
model->changeImports(imports, {});
try {
model->changeImports(imports, {});
} catch (const Exception &e) {
e.showException();
}
switchToComponentsView();
updateSearch();