Fixes: Another possible crash

This commit is contained in:
Roberto Raggi
2009-02-09 20:30:56 +01:00
parent c842957a8b
commit 0504fdd00b

View File

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