diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-01-06 12:16:11 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-01-06 12:32:29 +0100 |
commit | 0fdb3bebee7e3fa98caf333239549b28717043a8 (patch) | |
tree | b12184032ba6a446ca4b327cc9c1163f43871009 | |
parent | 738a950b754d1197d686acb1b04a5fdc883a02e5 (diff) | |
download | qt-creator-0fdb3bebee7e3fa98caf333239549b28717043a8.tar.gz |
Fixed crash when completing symbols without a valid context.
Task-number: QTCREATORBUG-534
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
-rw-r--r-- | src/libs/cplusplus/LookupContext.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 507a5d99aa..983a705e71 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -352,8 +352,10 @@ QList<Scope *> LookupContext::visibleScopes(const QPair<FullySpecifiedType, Symb QList<Scope *> LookupContext::visibleScopes(Symbol *symbol) const { QList<Scope *> scopes; - for (Scope *scope = symbol->scope(); scope; scope = scope->enclosingScope()) - scopes.append(scope); + if (symbol) { + for (Scope *scope = symbol->scope(); scope; scope = scope->enclosingScope()) + scopes.append(scope); + } scopes += visibleScopes(); scopes = expand(scopes); return scopes; |