From d209bd72db8be026815fdb81dc32dbde13981de3 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Mon, 5 Jul 2010 12:48:47 +0200
Subject: [PATCH] Check for possible 0x0 access.

---
 src/plugins/cppeditor/cppquickfix.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/cppeditor/cppquickfix.cpp b/src/plugins/cppeditor/cppquickfix.cpp
index 4cb5f944355..5fa31660ebf 100644
--- a/src/plugins/cppeditor/cppquickfix.cpp
+++ b/src/plugins/cppeditor/cppquickfix.cpp
@@ -443,7 +443,7 @@ public:
         // show when we're on the 'if' of an if statement
         int index = path.size() - 1;
         IfStatementAST *ifStatement = path.at(index)->asIfStatement();
-        if (ifStatement && isCursorOn(ifStatement->if_token)
+        if (ifStatement && isCursorOn(ifStatement->if_token) && ifStatement->statement
             && ! ifStatement->statement->asCompoundStatement()) {
             _statement = ifStatement->statement;
             return index;
-- 
GitLab