Fix crash of tst_ImportCheck

We don't have a PluginManager instance when running the autotests.

Change-Id: Ib36ea2bb58e500a2ad4b601cedfb8d426fda7e4e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2022-06-10 11:00:14 +02:00
parent d06d6ebeba
commit fc636755af

View File

@@ -969,7 +969,8 @@ void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths,
doc->parse();
#ifdef WITH_TESTS
if (ExtensionSystem::PluginManager::isScenarioRunning("TestModelManagerInterface")) {
if (ExtensionSystem::PluginManager::instance() // we might run as an auto-test
&& ExtensionSystem::PluginManager::isScenarioRunning("TestModelManagerInterface")) {
ExtensionSystem::PluginManager::waitForScenarioFullyInitialized();
if (ExtensionSystem::PluginManager::finishScenario()) {
qDebug() << "Point 1: Shutdown triggered";