Skip to content
Snippets Groups Projects
Commit 69969bef authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed possible crash on constructor completion


When constructor completion was attempted on a base class specified in a
class declaration, a null pointer reference would occur.

Task-number: QTCREATORBUG-321
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent e106e218
No related branches found
No related tags found
No related merge requests found
......@@ -1069,7 +1069,8 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi
if (doc->parse(Document::ParseDeclaration)) {
doc->check();
if (SimpleDeclarationAST *sd = doc->translationUnit()->ast()->asSimpleDeclaration()) {
if (sd->declarators->declarator->postfix_declarators
if (sd->declarators &&
sd->declarators->declarator->postfix_declarators
&& sd->declarators->declarator->postfix_declarators->asFunctionDeclarator()) {
autocompleteSignature = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment