summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-10 13:45:19 +0100
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-10 13:56:13 +0100
commit885d908ea336de72e7fce2141c1060e425f2af0a (patch)
tree7465387399beb78e982e020fbc6c134c3a8b8942 /src
parent678488e7d93aee37aef4dc0a2b4af3ef1210b3dc (diff)
downloadqt-creator-885d908ea336de72e7fce2141c1060e425f2af0a.tar.gz
Fixed two crashes with C++ engine handling
These checks are necessary cause of a recent change in the C++ engine. Reviewed-by: Roberto Raggi
Diffstat (limited to 'src')
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp2
-rw-r--r--src/shared/cplusplus/Scope.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 3959d953f9..2547b8564d 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -256,7 +256,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
const QList<TypeOfExpression::Result> types =
typeOfExpression(expression, doc, lastSymbol);
- if (!types.isEmpty()) {
+ if (!types.isEmpty() && types.first().first) {
FullySpecifiedType firstType = types.first().first;
Symbol *symbol = types.first().second;
FullySpecifiedType docType = firstType;
diff --git a/src/shared/cplusplus/Scope.cpp b/src/shared/cplusplus/Scope.cpp
index efb6a369ae..200406b6bb 100644
--- a/src/shared/cplusplus/Scope.cpp
+++ b/src/shared/cplusplus/Scope.cpp
@@ -217,7 +217,7 @@ void Scope::enterSymbol(Symbol *symbol)
Symbol *Scope::lookat(Identifier *id) const
{
- if (! _hash)
+ if (! _hash || ! id)
return 0;
const unsigned h = id->hashCode() % _hashSize;