1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 18:55:38 +02:00

bug 357442: Protect EnvVarCollector against NPE when array of environment variables contains null

This commit is contained in:
Andrew Gvozdev 2013-03-10 07:05:35 -04:00
parent 180b192054
commit e034731fee

View file

@ -49,6 +49,7 @@ public class EnvVarCollector {
boolean isCaseInsensitive = !EnvironmentVariableManager.getDefault().isVariableCaseSensitive(); boolean isCaseInsensitive = !EnvironmentVariableManager.getDefault().isVariableCaseSensitive();
for(int i = 0; i < vars.length; i ++) { for(int i = 0; i < vars.length; i ++) {
IEnvironmentVariable var = vars[i]; IEnvironmentVariable var = vars[i];
if (var != null) {
String name = var.getName(); String name = var.getName();
if(isCaseInsensitive) if(isCaseInsensitive)
name = name.toUpperCase(); name = name.toUpperCase();
@ -72,6 +73,7 @@ public class EnvVarCollector {
} }
} }
} }
}
/** /**
* Returns an array of variables held by this collector * Returns an array of variables held by this collector