forked from qt-creator/qt-creator
LanguageClient: add asserts and early returns for null clients
Change-Id: I6f972dbe931e27b2d30b048b413e95aea1fca282 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -660,7 +660,8 @@ void LanguageClientManager::documentOpened(Core::IDocument *document)
|
|||||||
clients.removeAll(clientForProject);
|
clients.removeAll(clientForProject);
|
||||||
}
|
}
|
||||||
} else if (setting->m_startBehavior == BaseSettings::RequiresFile && clients.isEmpty()) {
|
} else if (setting->m_startBehavior == BaseSettings::RequiresFile && clients.isEmpty()) {
|
||||||
clients << startClient(setting);
|
if (Client *client = startClient(setting); QTC_GUARD(client))
|
||||||
|
clients << client;
|
||||||
}
|
}
|
||||||
allClients << clients;
|
allClients << clients;
|
||||||
}
|
}
|
||||||
|
@@ -618,6 +618,7 @@ Client *BaseSettings::createClient(ProjectExplorer::Project *project) const
|
|||||||
BaseClientInterface *interface = createInterface(project);
|
BaseClientInterface *interface = createInterface(project);
|
||||||
QTC_ASSERT(interface, return nullptr);
|
QTC_ASSERT(interface, return nullptr);
|
||||||
auto *client = createClient(interface);
|
auto *client = createClient(interface);
|
||||||
|
QTC_ASSERT(client, return nullptr);
|
||||||
|
|
||||||
if (client->name().isEmpty())
|
if (client->name().isEmpty())
|
||||||
client->setName(Utils::globalMacroExpander()->expand(m_name));
|
client->setName(Utils::globalMacroExpander()->expand(m_name));
|
||||||
|
Reference in New Issue
Block a user