fix npe on files with no content
This commit is contained in:
parent
9b6f1f8d25
commit
f749715f14
@ -15,6 +15,7 @@
|
||||
|
||||
### Fixed
|
||||
- Character unescaping for '.properties' files
|
||||
- Exception on json files without any content
|
||||
|
||||
## [2.0.0]
|
||||
### BREAKING CHANGES
|
||||
|
@ -36,7 +36,9 @@ public class JsonParserStrategy extends ParserStrategy {
|
||||
|
||||
try(Reader reader = new InputStreamReader(vf.getInputStream(), vf.getCharset())) {
|
||||
JsonObject input = GSON.fromJson(reader, JsonObject.class);
|
||||
JsonMapper.read(file.getLocale(), input, targetNode);
|
||||
if(input != null) { // @input is null if file is completely empty
|
||||
JsonMapper.read(file.getLocale(), input, targetNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user