1
0
Fork 0
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:
Markus Schorn 2008-01-30 13:49:23 +00:00
parent 199906029b
commit f73c67a3a1

View file

@ -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;