Fix NPE with no resource
This commit is contained in:
parent
3f7fbe076a
commit
d96897d5ae
1 changed files with 8 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue