aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-12-21 00:50:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-12-21 09:51:07 +1300
commit49d36d2914e6662311d75f92ddd81372858fd658 (patch)
tree8a95b4c9fd082fa3d9c4ff6399c675437571e6ac /src/org/traccar/database/DeviceManager.java
parent4fb9b7e1467baf57f54e47ab962c6af1769680c0 (diff)
downloadtrackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.tar.gz
trackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.tar.bz2
trackermap-server-49d36d2914e6662311d75f92ddd81372858fd658.zip
Handle null phone (fix #3691)
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r--src/org/traccar/database/DeviceManager.java5
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);
}