1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +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) {
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);
}
}
}