Skip to content

Commit cdd277d

Browse files
authored
Fix config BigDecimal parsing returning null on error (#5373)
Also add some more exception logging for parse issues.
1 parent 0d322e2 commit cdd277d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Essentials/src/main/java/com/earth2me/essentials/config/EssentialsConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public LazyLocation getLocation(final String path) throws InvalidWorldException
131131
try {
132132
return node.get(LazyLocation.class);
133133
} catch (SerializationException e) {
134+
Essentials.getWrappedLogger().log(Level.SEVERE, e.getMessage(), e);
134135
return null;
135136
}
136137
}
@@ -272,7 +273,8 @@ public BigDecimal getBigDecimal(final String path, final BigDecimal def) {
272273
try {
273274
return node.get(BigDecimal.class);
274275
} catch (SerializationException e) {
275-
return null;
276+
Essentials.getWrappedLogger().log(Level.SEVERE, e.getMessage(), e);
277+
return def;
276278
}
277279
}
278280

0 commit comments

Comments
 (0)