Commit 3891f7e0 authored by Eric Armbruster's avatar Eric Armbruster 🍁
Browse files

Don't crash in tab context menu if there is no active view

parent 66a4c7ca
......@@ -927,9 +927,13 @@ void KateViewSpace::showContextMenu(int idx, const QPoint &globalPos)
return;
}
auto activeView = KTextEditor::Editor::instance()->application()->activeMainWindow()->activeView();
if (!activeView) {
return; // the welcome screen is open
}
auto *doc = m_tabBar->tabDocument(idx);
auto activeDocument =
KTextEditor::Editor::instance()->application()->activeMainWindow()->activeView()->document(); // used for compareUsing which is used with another
auto activeDocument = activeView->document(); // used for compareUsing which is used with another
if (!doc) {
// This tab is holding some other widget
// Show only "close tab" for now
......
Supports Markdown
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