forked from qt-creator/qt-creator
CppTools: Fix crash for documents without file paths
Since commit 566be09 we might reparse the current document if the
current editor changes. This is fine as long as the current document has
a file path, which is not always true, especially for the documents
created in the FakeVim tests.
Task-number: QTCREATORBUG-10767
Change-Id: Ibe00ef8bb6a144e2ba09b311025d238c2dcde112
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -286,7 +286,7 @@ static void parse(QFutureInterface<void> &future, CppEditorSupport *support)
|
||||
QSharedPointer<SnapshotUpdater> updater = support->snapshotUpdater();
|
||||
|
||||
updater->update(cmm->workingCopy());
|
||||
cmm->finishedRefreshingSourceFiles(QStringList(updater->document()->fileName()));
|
||||
cmm->finishedRefreshingSourceFiles(QStringList(updater->fileInEditor()));
|
||||
|
||||
future.setProgressValue(1);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ void CppEditorSupport::updateDocumentNow()
|
||||
} else {
|
||||
m_updateDocumentTimer->stop();
|
||||
|
||||
if (m_fileIsBeingReloaded)
|
||||
if (m_fileIsBeingReloaded || fileName().isEmpty())
|
||||
return;
|
||||
|
||||
if (m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo())
|
||||
|
||||
Reference in New Issue
Block a user