LanguageClient: Fix possbible crash in inspector

... when clearing.

Change-Id: Iadb57c07562fab77a65bcad38cf509dd1af6c0c3
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-16 14:42:03 +02:00
parent 6c4c310278
commit fc35635942

View File

@@ -431,7 +431,8 @@ LspInspectorWidget::LspInspectorWidget(LspInspector *inspector)
const auto clearButton = buttonBox->addButton(tr("Clear"), QDialogButtonBox::ResetRole);
connect(clearButton, &QPushButton::clicked, this, [this] {
m_inspector->clear();
currentClientChanged(m_clients->currentItem()->text());
if (m_clients->currentItem())
currentClientChanged(m_clients->currentItem()->text());
});
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);