mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-22 01:48:50 +00:00
fix: 修复可能存在的空指针
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
c9bc929cec
commit
1c85776b8a
@ -54,9 +54,8 @@ public class InjectParse {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date parse(ConfigurationSection config, String path) {
|
public Date parse(ConfigurationSection config, String path) {
|
||||||
String value = "0000-00-00 00:00:00";
|
String value = config.getString(path) == null ? "0000-00-00 00:00:00" : config.getString(path);
|
||||||
try {
|
try {
|
||||||
value = config.getString(path);
|
|
||||||
return df.parse(value);
|
return df.parse(value);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new ConfigParseException(String.format(DATE_PARSE_ERROR, path, DATE_FORMAT, value), e);
|
throw new ConfigParseException(String.format(DATE_PARSE_ERROR, path, DATE_FORMAT, value), e);
|
||||||
|
Loading…
Reference in New Issue
Block a user