Skip to content

Commit

Permalink
Handle null phone (fix traccar#3691)
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Dec 20, 2017
1 parent 4fb9b7e commit 49d36d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/org/traccar/database/DeviceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ protected void updateCachedItem(Device device) {
}
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);
}
Expand Down

0 comments on commit 49d36d2

Please sign in to comment.