aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/config/Config.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/config/Config.java b/src/main/java/org/traccar/config/Config.java
index 409a3f16a..2d76a5c70 100644
--- a/src/main/java/org/traccar/config/Config.java
+++ b/src/main/java/org/traccar/config/Config.java
@@ -92,7 +92,13 @@ public class Config {
}
public boolean getBoolean(ConfigKey<Boolean> key) {
- return Boolean.parseBoolean(getString(key.getKey()));
+ String value = getString(key.getKey());
+ if (value != null) {
+ return Boolean.parseBoolean(value);
+ } else {
+ Boolean defaultValue = key.getDefaultValue();
+ return Objects.requireNonNullElse(defaultValue, false);
+ }
}
public int getInteger(ConfigKey<Integer> key) {