From 49d36d2914e6662311d75f92ddd81372858fd658 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 21 Dec 2017 00:50:33 +1300 Subject: Handle null phone (fix #3691) --- src/org/traccar/database/DeviceManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/org/traccar') 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 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); } -- cgit v1.2.3