diff options
Diffstat (limited to 'src/org/traccar/protocol/WondexProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/WondexProtocolEncoder.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/WondexProtocolEncoder.java b/src/org/traccar/protocol/WondexProtocolEncoder.java index 20341ae8d..7a323e4a8 100644 --- a/src/org/traccar/protocol/WondexProtocolEncoder.java +++ b/src/org/traccar/protocol/WondexProtocolEncoder.java @@ -13,11 +13,10 @@ public class WondexProtocolEncoder extends StringProtocolEncoder { command.set(Command.KEY_DEVICE_PASSWORD, "0000"); if (Context.getDeviceManager() != null) { Device device = Context.getDeviceManager().getDeviceById(command.getDeviceId()); - if (device != null) { - if (device.getAttributes().containsKey(Command.KEY_DEVICE_PASSWORD)) { - command.set(Command.KEY_DEVICE_PASSWORD, device.getAttributes().get(Command.KEY_DEVICE_PASSWORD).toString()); + if (device != null && device.getAttributes().containsKey(Command.KEY_DEVICE_PASSWORD)) { + command.set(Command.KEY_DEVICE_PASSWORD, device.getAttributes() + .get(Command.KEY_DEVICE_PASSWORD).toString()); } - } } switch (command.getType()) { |