From daa20f98b46843d6c64c7b4aa42e402dfb3ea157 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Tue, 6 Jan 2015 10:04:34 -0500 Subject: [PATCH] Bug 453398: NPE in SupplierBasedCdtVariableSubstitutor ("Expand env.variable refs") Change-Id: I4ff9f5191ac5ffe5e5b34b8aba7758aa4965b213 Signed-off-by: Andrew Gvozdev Reviewed-on: https://git.eclipse.org/r/39047 Reviewed-by: Sergey Prigogin Reviewed-by: Doug Schaefer Tested-by: Hudson CI --- .../cdtvariables/SupplierBasedCdtVariableSubstitutor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java index ff128c1e4d9..87f3085594e 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java @@ -285,7 +285,11 @@ public class SupplierBasedCdtVariableSubstitutor implements IVariableSubstitutor } protected ResolvedMacro resolveMacro(String macroName) throws CdtVariableException{ - return resolveMacro(SupplierBasedCdtVariableManager.getVariable(macroName,fContextInfo,true)); + ICdtVariable variable = SupplierBasedCdtVariableManager.getVariable(macroName,fContextInfo,true); + if (variable == null) + return null; + + return resolveMacro(variable); } protected ResolvedMacro resolveParentMacro(MacroDescriptor macroDes) throws CdtVariableException{