Fix NPE with no resource

This commit is contained in:
Georgy Litvinov 2021-02-25 00:34:16 +01:00
parent 3f7fbe076a
commit d96897d5ae

View file

@ -47,8 +47,10 @@ public class ConverterFactory {
InputStream stream = loader.getResourceAsStream(propPath);
String version = "Failed to get version";
try {
prop.load(stream);
version = (String) prop.get("releaseVersion");
if (stream != null) {
prop.load(stream);
version = (String) prop.get("releaseVersion");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -65,8 +67,10 @@ public class ConverterFactory {
InputStream stream = loader.getResourceAsStream(propPath);
String date = "Failed to get date";
try {
prop.load(stream);
date = (String) prop.get("releaseDate");
if (stream != null) {
prop.load(stream);
date = (String) prop.get("releaseDate");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();