diff options
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index 0f76f721d..4a48fe7b6 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -124,7 +124,9 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { } } - position.setNetwork(network); + if (network.getCellTowers() != null || network.getWifiAccessPoints() != null) { + position.setNetwork(network); + } } @Override diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 20e033e3b..955e0b788 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -178,7 +178,7 @@ public class ProtocolTest extends BaseTest { Assert.assertFalse("no attributes", attributes.isEmpty()); } - if (position.getNetwork() != null) { + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); checkInteger(cellTower.getMobileNetworkCode(), 0, 999); |