From f73c67a3a14bd91a6154e82318a10020ba713e0e Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 30 Jan 2008 13:49:23 +0000 Subject: [PATCH] Fixes a NPE in name-lookup. --- .../eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java index 7610b786117..62f24d0323a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java @@ -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;