diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 115bf0475b7..19b261c42f4 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -484,6 +484,9 @@ ProjectPart *findProjectPartForCurrentProject(const QList &pro ProjectPart *CppEditorWidget::projectPart() const { + if (!d->m_modelManager) + return 0; + auto projectParts = fetchProjectParts(d->m_modelManager, textDocument()->filePath()); return findProjectPartForCurrentProject(projectParts,