8208157: requires.VMProps throws NPE for missing properties in "release" file

Reviewed-by: iignatyev, lancea
This commit is contained in:
Alexandre Iline 2018-07-24 08:58:32 -07:00
parent 955ce37d60
commit ffc4cbe5da

View File

@ -432,7 +432,8 @@ public class VMProps implements Callable<Map<String, String>> {
System.getProperty("java.home") + "/release"))) {
Properties properties = new Properties();
properties.load(in);
return properties.getProperty("IMPLEMENTOR").replace("\"", "");
String implementorProperty = properties.getProperty("IMPLEMENTOR");
return (implementorProperty == null) ? "null" : implementorProperty.replace("\"", "");
} catch (IOException e) {
e.printStackTrace();
}