mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
bug 357442: Protect EnvVarCollector against NPE when array of environment variables contains null
This commit is contained in:
parent
180b192054
commit
e034731fee
1 changed files with 22 additions and 20 deletions
|
@ -49,6 +49,7 @@ public class EnvVarCollector {
|
|||
boolean isCaseInsensitive = !EnvironmentVariableManager.getDefault().isVariableCaseSensitive();
|
||||
for(int i = 0; i < vars.length; i ++) {
|
||||
IEnvironmentVariable var = vars[i];
|
||||
if (var != null) {
|
||||
String name = var.getName();
|
||||
if(isCaseInsensitive)
|
||||
name = name.toUpperCase();
|
||||
|
@ -72,6 +73,7 @@ public class EnvVarCollector {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of variables held by this collector
|
||||
|
|
Loading…
Add table
Reference in a new issue