diff options
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-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); } |