Browse Source

when updating Device, set deviceType to 'other' if null or uninitialized

tags/v0.9.11
Jonathan Cobb 4 years ago
parent
commit
95892394b7
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java

+ 3
- 0
bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java View File

@@ -76,6 +76,9 @@ public class DeviceDAO extends AccountOwnedEntityDAO<Device> {
if (current != null && current.uninitialized()) {
device.initTotpKey();
}
if (device.getDeviceType() == null || device.getDeviceType() == BubbleDeviceType.uninitialized) {
device.setDeviceType(BubbleDeviceType.other);
}
final Device updated = super.update(device);
ensureSpareDevice(device.getAccount(), device.getNetwork(), true);
return updated;


Loading…
Cancel
Save