mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Fixes a NPE in name-lookup.
This commit is contained in:
parent
199906029b
commit
f73c67a3a1
1 changed files with 1 additions and 1 deletions
|
@ -1168,7 +1168,7 @@ public class CPPSemantics {
|
|||
private static IScope getParentScope(IScope scope, IASTTranslationUnit unit) throws DOMException {
|
||||
IScope parentScope= scope.getParent();
|
||||
// the index cannot return the translation unit as parent scope
|
||||
if (parentScope == null && scope instanceof IIndexScope) {
|
||||
if (parentScope == null && scope instanceof IIndexScope && unit != null) {
|
||||
parentScope= unit.getScope();
|
||||
}
|
||||
return parentScope;
|
||||
|
|
Loading…
Add table
Reference in a new issue