diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-27 23:03:11 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 23:03:11 +1200 |
commit | 5d6dec7818a8059c958fc896eb1de838fda52a8c (patch) | |
tree | f5759e40bbf8f9e3a4cee79b9829b27dbbef47c6 /src/org/traccar/database/DeviceManager.java | |
parent | 495b2aa2d2b17bd1a5803ea0bd7dcc64bc81c598 (diff) | |
parent | ec82098c6bc3c84672665552839a97ddb6771afc (diff) | |
download | trackermap-server-5d6dec7818a8059c958fc896eb1de838fda52a8c.tar.gz trackermap-server-5d6dec7818a8059c958fc896eb1de838fda52a8c.tar.bz2 trackermap-server-5d6dec7818a8059c958fc896eb1de838fda52a8c.zip |
Merge pull request #3397 from Abyss777/fix_empty_devices
Initialize some maps, because they might be accessed before initialized.
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r-- | src/org/traccar/database/DeviceManager.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 4aafe6631..5d123f9b8 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -57,6 +57,12 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity public DeviceManager(DataManager dataManager) { super(dataManager, Device.class); this.config = Context.getConfig(); + if (devicesByPhone == null) { + devicesByPhone = new ConcurrentHashMap<>(); + } + if (devicesByUniqueId == null) { + devicesByUniqueId = new ConcurrentHashMap<>(); + } dataRefreshDelay = config.getLong("database.refreshDelay", DEFAULT_REFRESH_DELAY) * 1000; lookupGroupsAttribute = config.getBoolean("deviceManager.lookupGroupsAttribute"); fallbackToText = config.getBoolean("command.fallbackToSms"); |