Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-05-25 19:28:34 +0000
committerJonah Graham2018-05-28 17:42:51 +0000
commitce857c058c4eebc8e175d12d445a6f54e9ec7c57 (patch)
tree3be0fa2594045e0ab37836b89603ebfae3bffa4e
parente5c7bb64f7ea88b517281d8ed312115c3123f322 (diff)
downloadorg.eclipse.cdt-ce857c058c4eebc8e175d12d445a6f54e9ec7c57.tar.gz
org.eclipse.cdt-ce857c058c4eebc8e175d12d445a6f54e9ec7c57.tar.xz
org.eclipse.cdt-ce857c058c4eebc8e175d12d445a6f54e9ec7c57.zip
Bug 535139 - Container target set-up causes NPE
- add null check before accessing ordered tool chains Change-Id: I713a55f8e887b642aa4a159e59c454de9a97955a
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java24
1 files changed, 13 insertions, 11 deletions
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<IToolChain> getToolChainsMatching(Map<String, String> properties) {
init();
List<IToolChain> tcs = new ArrayList<>();
- for (IToolChain toolChain : orderedToolChains) {
- boolean matches = true;
- for (Map.Entry<String, String> 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<String, String> 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);
+ }
}
}

Back to the top