From 0b4802c682ec3244f3c5dfbc9a666c47a79bd349 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Fri, 13 Feb 2009 17:43:06 +0100 Subject: [PATCH] Fixes: Possible crash in buildHelpId --- src/plugins/cppeditor/cpphoverhandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 8f371bb2870..e47fbe65812 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -158,8 +158,10 @@ static QString buildHelpId(const FullySpecifiedType &type, scope = e->scope(); } else if (const NamedType *t = type->asNamedType()) { name = t->name(); - } else if (const Declaration *d = symbol->asDeclaration()) { - if (d->scope() && d->scope()->owner()->isEnum()) { + } else if (symbol && symbol->isDeclaration()) { + const Declaration *d = symbol->asDeclaration(); + + if (d->scope() && d->scope()->isEnumScope()) { name = d->name(); scope = d->scope(); } -- GitLab