diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index bb34174d06a..f27c0ce83c4 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -124,6 +124,9 @@ bool CppRefactoringFile::isCursorOn(unsigned tokenIndex) const bool CppRefactoringFile::isCursorOn(const AST *ast) const { + if (!ast) + return false; + QTextCursor tc = cursor(); int cursorBegin = tc.selectionStart();