diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 19b261c42f4..9b027d4135c 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -542,7 +542,8 @@ void CppEditorWidget::renameSymbolUnderCursorClang() { using ClangBackEnd::SourceLocationsContainer; - if (refactoringEngine()->isUsable()) { + ProjectPart *theProjectPart = projectPart(); + if (refactoringEngine()->isUsable() && theProjectPart) { d->m_useSelectionsUpdater.abortSchedule(); QPointer cppEditorWidget = this; @@ -569,7 +570,7 @@ void CppEditorWidget::renameSymbolUnderCursorClang() refactoringEngine()->startLocalRenaming(textCursor(), textDocument()->filePath(), document()->revision(), - projectPart(), + theProjectPart, std::move(renameSymbols)); viewport()->setCursor(Qt::BusyCursor);