From 3b89c766f6232359f7e82a41b88d7bca472a8764 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 23 Feb 2017 20:19:21 +0100 Subject: [PATCH] CppEditor: Add guard in CppEditorWidget::projectPart() All other functions using d->m_modelManager already have such a guard so I assume it makes sense here, too. Change-Id: Ie503d126230d266f57fceba9d9bae1b49849c7cd Reviewed-by: Nikolai Kosjar --- src/plugins/cppeditor/cppeditor.cpp | 3 +++ 1 file changed, 3 insertions(+) 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,