diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java index fc60b74cdb2..7c882ddb1cf 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java @@ -189,19 +189,21 @@ public class ToolChainManager implements IToolChainManager { public Collection getToolChainsMatching(Map properties) { init(); List tcs = new ArrayList<>(); - for (IToolChain toolChain : orderedToolChains) { - boolean matches = true; - for (Map.Entry property : properties.entrySet()) { - String tcProperty = toolChain.getProperty(property.getKey()); - if (tcProperty != null) { - if (!property.getValue().equals(tcProperty)) { - matches = false; - break; + if (orderedToolChains != null) { + for (IToolChain toolChain : orderedToolChains) { + boolean matches = true; + for (Map.Entry property : properties.entrySet()) { + String tcProperty = toolChain.getProperty(property.getKey()); + if (tcProperty != null) { + if (!property.getValue().equals(tcProperty)) { + matches = false; + break; + } } } - } - if (matches) { - tcs.add(toolChain); + if (matches) { + tcs.add(toolChain); + } } }