Commit 8ff8f6b7 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Move null check in slotViewChanged

parent e86e3838
Pipeline #128879 passed with stage
in 3 minutes and 26 seconds
......@@ -171,9 +171,7 @@ KateExternalToolsPluginView::KateExternalToolsPluginView(KTextEditor::MainWindow
// ESC should close & hide ToolView
connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateExternalToolsPluginView::handleEsc);
connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KateExternalToolsPluginView::slotViewChanged);
if (auto view = m_mainWindow->activeView()) {
slotViewChanged(view);
}
slotViewChanged(m_mainWindow->activeView());
}
KateExternalToolsPluginView::~KateExternalToolsPluginView()
......@@ -280,6 +278,10 @@ void KateExternalToolsPluginView::slotViewChanged(KTextEditor::View *v)
}
m_currentView = v;
if (!m_currentView) {
return;
}
connect(v->document(), &KTextEditor::Document::documentSavedOrUploaded, this, &KateExternalToolsPluginView::onDocumentSaved, Qt::UniqueConnection);
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 90, 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment