forked from qt-creator/qt-creator
LanguageClient: prevent crash in LanguageClientManager
This also prevents assigning a client to a nullptr document. Change-Id: Iacefe141a08fd47e69faacd4b0cd156c264ac19b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -420,6 +420,8 @@ const QList<Client *> LanguageClientManager::clientsForProject(
|
||||
|
||||
void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *document, Client *client)
|
||||
{
|
||||
if (!document)
|
||||
return;
|
||||
Client *currentClient = clientForDocument(document);
|
||||
if (client == currentClient)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user