Fix boolean properties

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-11-10 23:34:19 +01:00
parent dc6a520ab5
commit e9a3144606
1 changed files with 2 additions and 1 deletions

View File

@ -316,7 +316,8 @@ public final class PacketUtils {
private static boolean getBoolean(String name, boolean defaultValue) {
boolean result = defaultValue;
try {
result = Boolean.parseBoolean(System.getProperty(name));
final String value = System.getProperty(name);
if (value != null) result = Boolean.parseBoolean(value);
} catch (IllegalArgumentException | NullPointerException ignored) {
}
return result;