1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-30 19:53:30 +02:00

Bug 535139 - Container target set-up causes NPE

- add null check before accessing ordered tool chains

Change-Id: I713a55f8e887b642aa4a159e59c454de9a97955a
This commit is contained in:
Jeff Johnston 2018-05-25 15:28:34 -04:00 committed by Jonah Graham
parent e5c7bb64f7
commit ce857c058c

View file

@ -189,19 +189,21 @@ public class ToolChainManager implements IToolChainManager {
public Collection<IToolChain> getToolChainsMatching(Map<String, String> properties) { public Collection<IToolChain> getToolChainsMatching(Map<String, String> properties) {
init(); init();
List<IToolChain> tcs = new ArrayList<>(); List<IToolChain> tcs = new ArrayList<>();
for (IToolChain toolChain : orderedToolChains) { if (orderedToolChains != null) {
boolean matches = true; for (IToolChain toolChain : orderedToolChains) {
for (Map.Entry<String, String> property : properties.entrySet()) { boolean matches = true;
String tcProperty = toolChain.getProperty(property.getKey()); for (Map.Entry<String, String> property : properties.entrySet()) {
if (tcProperty != null) { String tcProperty = toolChain.getProperty(property.getKey());
if (!property.getValue().equals(tcProperty)) { if (tcProperty != null) {
matches = false; if (!property.getValue().equals(tcProperty)) {
break; matches = false;
break;
}
} }
} }
} if (matches) {
if (matches) { tcs.add(toolChain);
tcs.add(toolChain); }
} }
} }