diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-21 00:50:33 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-21 09:51:07 +1300 |
commit | 49d36d2914e6662311d75f92ddd81372858fd658 (patch) | |
tree | 8a95b4c9fd082fa3d9c4ff6399c675437571e6ac /src | |
parent | 4fb9b7e1467baf57f54e47ab962c6af1769680c0 (diff) | |
download | trackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.tar.gz trackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.tar.bz2 trackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.zip |
Handle null phone (fix #3691)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/database/DeviceManager.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 1eb90b7eb..1031c5da9 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -168,7 +168,10 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity } if (device.getPhone() != null && !device.getPhone().isEmpty() && !device.getPhone().equals(cachedDevice.getPhone())) { - devicesByPhone.remove(cachedDevice.getPhone()); + String phone = cachedDevice.getPhone(); + if (phone != null && !phone.isEmpty()) { + devicesByPhone.remove(phone); + } cachedDevice.setPhone(device.getPhone()); putPhone(cachedDevice); } |