Editors: Fix soft assert about empty currentView

We need to always either have a current view or a current editor.
Make sure we set the current view if we end up without a current
editor when closing files.

Amends ee1e6ca508

Fixes: QTCREATORBUG-24869
Change-Id: I9e1982697700079e037695e100ef71eadaf7849f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-03-11 16:09:18 +01:00
parent e2112d6831
commit 280545fdf8

View File

@@ -1743,10 +1743,12 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
foreach (IEditor *editor, acceptedEditors)
delete editor;
if (focusView)
if (focusView) {
activateView(focusView);
else
} else {
setCurrentView(currentView);
setCurrentEditor(currentView->currentEditor());
}
if (!EditorManager::currentEditor()) {
emit m_instance->currentEditorChanged(nullptr);