From c9dc00136c4d5250274ad44c35a10eab7816fd8c Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Thu, 29 Aug 2013 17:17:02 -0700 Subject: [PATCH] Fixed an NPE. --- .../refactoring/includes/BindingClassifier.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java index ff14c6450d6..9fedffccacb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java @@ -310,13 +310,15 @@ public class BindingClassifier { ICPPTemplateParameterMap parameterMap = ((ICPPSpecialization) binding).getTemplateParameterMap(); for (Integer position : parameterMap.getAllParameterPositions()) { ICPPTemplateArgument argument = parameterMap.getArgument(position); - IType type = argument.getTypeValue(); - // Normally we don't need to define parameters of a template specialization that - // were not specified explicitly. __gnu_cxx::hash is an exception from that rule. - if (type instanceof IBinding && "hash".equals(((IBinding) type).getName())) { //$NON-NLS-1$ - IBinding owner = ((IBinding) type).getOwner(); - if (owner instanceof ICPPNamespace && "__gnu_cxx".equals(owner.getName())) //$NON-NLS-1$ - bindings.add((IBinding) type); + if (argument != null) { + IType type = argument.getTypeValue(); + // Normally we don't need to define parameters of a template specialization that + // were not specified explicitly. __gnu_cxx::hash is an exception from that rule. + if (type instanceof IBinding && "hash".equals(((IBinding) type).getName())) { //$NON-NLS-1$ + IBinding owner = ((IBinding) type).getOwner(); + if (owner instanceof ICPPNamespace && "__gnu_cxx".equals(owner.getName())) //$NON-NLS-1$ + bindings.add((IBinding) type); + } } } // Get the specialized binding - e.g. get the binding for X if the current binding is