From 885d908ea336de72e7fce2141c1060e425f2af0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 10 Feb 2009 13:45:19 +0100 Subject: [PATCH] Fixed two crashes with C++ engine handling These checks are necessary cause of a recent change in the C++ engine. Reviewed-by: Roberto Raggi --- src/plugins/cppeditor/cpphoverhandler.cpp | 2 +- src/shared/cplusplus/Scope.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 3959d953f92..2547b8564d9 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 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 efb6a369aec..200406b6bb5 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;