From 0504fdd00bce8d9580a52335093b57215f4272da Mon Sep 17 00:00:00 2001
From: Roberto Raggi <qtc-committer@nokia.com>
Date: Mon, 9 Feb 2009 20:30:56 +0100
Subject: [PATCH] Fixes: Another possible crash

---
 src/plugins/cpptools/cppcodecompletion.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp
index c1dc1e0ddb2..9a4720702c4 100644
--- a/src/plugins/cpptools/cppcodecompletion.cpp
+++ b/src/plugins/cpptools/cppcodecompletion.cpp
@@ -1119,7 +1119,8 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
 
                         // If the function doesn't return anything, automatically place the semicolon,
                         // unless we're doing a scope completion (then it might be function definition).
-                        if (function->returnType()->isVoidType() && m_completionOperator != T_COLON_COLON) {
+                        FullySpecifiedType retTy = function->returnType();
+                        if (retTy && retTy->isVoidType() && m_completionOperator != T_COLON_COLON) {
                             toInsert.append(QLatin1Char(';'));
                         }
                     }
-- 
GitLab