aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config/Config.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/config/Config.java')
-rw-r--r--src/main/java/org/traccar/config/Config.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/config/Config.java b/src/main/java/org/traccar/config/Config.java
index 713f5c607..dd61e1f00 100644
--- a/src/main/java/org/traccar/config/Config.java
+++ b/src/main/java/org/traccar/config/Config.java
@@ -99,7 +99,17 @@ public class Config {
}
public int getInteger(ConfigKey<Integer> key) {
- return getInteger(key.getKey());
+ String value = getString(key.getKey());
+ if (value != null) {
+ return Integer.parseInt(value);
+ } else {
+ Integer defaultValue = key.getDefaultValue();
+ if (defaultValue != null) {
+ return defaultValue;
+ } else {
+ return 0;
+ }
+ }
}
@Deprecated