diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 4d6dc676232..9848b30ab1d 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -270,7 +270,8 @@ void EditorView::updateEditorHistory(IEditor *editor, QList &histo for (int i = 0; i < history.size(); ++i) { const EditLocation &item = history.at(i); if (item.document == document - || !DocumentModel::indexOfFilePath(FileName::fromString(item.fileName))) { + || (!item.document + && !DocumentModel::indexOfFilePath(FileName::fromString(item.fileName)))) { history.removeAt(i--); } }