From 77e2eefe30685d0988bdffeac617e7d0d8560bd0 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 21 Dec 2011 15:19:29 +0100 Subject: [PATCH] Bug 364920: NPE using call hierarchy --- .../cdt/internal/ui/callhierarchy/CallHierarchyUI.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java index 16e47b55921..a0554cee9fc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java @@ -32,6 +32,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IFunction; +import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.c.ICExternalBinding; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression; @@ -297,7 +298,8 @@ public class CallHierarchyUI { if (binding instanceof IVariable) { try { - if (binding.getScope().getKind() == EScopeKind.eLocal) + final IScope scope = binding.getScope(); + if (scope != null && scope.getKind() == EScopeKind.eLocal) return false; } catch (DOMException e) { }