Check for null scope when hovering.

Fixes a segfault when hovering over QtCleanUpFunction in
qcoreapplication.h.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2009-10-26 10:33:32 +01:00
parent dc8318853a
commit 3e953b0323

View File

@@ -337,7 +337,8 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
firstType = resolve(firstType, typeOfExpression.lookupContext(),
&resolvedSymbol, &resolvedName);
if (resolvedSymbol && resolvedSymbol->scope()->isClassScope()) {
if (resolvedSymbol && resolvedSymbol->scope()
&& resolvedSymbol->scope()->isClassScope()) {
Class *enclosingClass = resolvedSymbol->scope()->owner()->asClass();
if (Identifier *id = enclosingClass->identifier()) {
if (id->isEqualTo(resolvedSymbol->identifier()))