diff options
author | ninioe <ninioe@gmail.com> | 2016-07-19 09:07:23 +0300 |
---|---|---|
committer | ninioe <ninioe@gmail.com> | 2016-07-19 09:07:23 +0300 |
commit | ef40f3317392068692606b484c6782b95b554cbf (patch) | |
tree | 41c48e6c87620a6444aed0ad5706a94e26b1662d /src/org/traccar/BaseProtocolDecoder.java | |
parent | 04627d7473e4ea21d6ecd950cbb3fdd6fa249429 (diff) | |
parent | d3e063cf9de8a45bed4dfe87b73aadfd8d2edeab (diff) | |
download | trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.gz trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.bz2 trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.zip |
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/BaseProtocolDecoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 3429f41f0..9a253e351 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -47,7 +47,9 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { Device device = Context.getIdentityManager().getDeviceByUniqueId(uniqueId); if (device != null) { deviceId = device.getId(); - Context.getConnectionManager().addActiveDevice(deviceId, protocol, channel, remoteAddress); + if (Context.getConnectionManager() != null) { + Context.getConnectionManager().addActiveDevice(deviceId, protocol, channel, remoteAddress); + } return true; } else { deviceId = 0; @@ -78,7 +80,7 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { public void getLastLocation(Position position, Date deviceTime) { position.setOutdated(true); - Position last = Context.getConnectionManager().getLastPosition(getDeviceId()); + Position last = Context.getIdentityManager().getLastPosition(getDeviceId()); if (last != null) { position.setFixTime(last.getFixTime()); position.setValid(last.getValid()); |