diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-12-28 21:45:05 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-12-28 21:45:05 -0800 |
commit | 4f3d413a3003d7b9295c2e6801e7f3033738f65e (patch) | |
tree | 6b512462ec636b49e4001ab5017e8d1eb3f1535f /src/main/java/org/traccar/config/Config.java | |
parent | 51704590a835057bf4850a5eaf8c5037d20f648a (diff) | |
download | trackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.tar.gz trackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.tar.bz2 trackermap-server-4f3d413a3003d7b9295c2e6801e7f3033738f65e.zip |
Migrate more keys
Diffstat (limited to 'src/main/java/org/traccar/config/Config.java')
-rw-r--r-- | src/main/java/org/traccar/config/Config.java | 12 |
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 |