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:
parent
e5c7bb64f7
commit
ce857c058c
1 changed files with 13 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue