diff options
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 72cf0573ad..1be7fcfd30 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1755,7 +1755,7 @@ void ProjectExplorerPlugin::showExternalFileWarning() if (d->m_currentNode || !d->m_currentProject) return; Core::IEditor *editor = Core::EditorManager::currentEditor(); - if (!editor) + if (!editor || editor->isTemporary()) return; Core::IDocument *document = editor->document(); if (!document) @@ -1765,8 +1765,10 @@ void ProjectExplorerPlugin::showExternalFileWarning() if (!infoBar->canInfoBeAdded(externalFileId)) return; Utils::FileName fileName = Utils::FileName::fromString(document->fileName()); + if (fileName.isEmpty()) + return; Utils::FileName projectDir = Utils::FileName::fromString(d->m_currentProject->projectDirectory()); - if (fileName.isChildOf(projectDir)) + if (projectDir.isEmpty() || fileName.isChildOf(projectDir)) return; // External file. Test if it under the same VCS QString topLevel; |