CppEditor: Fix possible null pointer access

Fixes: QTCREATORBUG-29484
Change-Id: I047ea13e6808902a3b0fb94b9eacdd48e411a22a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-08-10 15:23:17 +02:00
parent d2434d90dc
commit 66a6cceaf4

View File

@@ -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();