OSDN Git Service

Fixed crash in the cpp hover handler
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Fri, 12 Jun 2009 13:25:14 +0000 (15:25 +0200)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Fri, 12 Jun 2009 13:45:35 +0000 (15:45 +0200)
Didn't check whether the lookup actually returned a valid symbol before
accessing the name.

Reviewed-by: Roberto Raggi
src/plugins/cppeditor/cpphoverhandler.cpp

index 106b160..faa2fca 100644 (file)
@@ -328,7 +328,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
             Symbol *lookupSymbol = result.second;        // lookup symbol
 
             Symbol *resolvedSymbol = lookupSymbol;
-            Name *resolvedName = lookupSymbol->name();
+            Name *resolvedName = lookupSymbol ? lookupSymbol->name() : 0;
             firstType = resolve(firstType, typeOfExpression.lookupContext(),
                                 &resolvedSymbol, &resolvedName);