aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-08-20 16:42:44 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-08-20 16:42:44 +1200
commit98fd364db65daf847b2b76819cd36602aaef8d25 (patch)
tree8953166a3a68a79c1352d86ada248fb83a5fa6c5 /src/org
parent73ca03b412e5f10dccd9153c1244aa53ccbd388b (diff)
downloadtraccar-server-98fd364db65daf847b2b76819cd36602aaef8d25.tar.gz
traccar-server-98fd364db65daf847b2b76819cd36602aaef8d25.tar.bz2
traccar-server-98fd364db65daf847b2b76819cd36602aaef8d25.zip
Handle zero MCC and MNC
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/AtrackProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java
index 1b10f7fa1..49f44a4f0 100644
--- a/src/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -128,8 +128,10 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
cellTower.setLocationAreaCode(Integer.parseInt(values[i]));
break;
case "CN":
- cellTower.setMobileCountryCode(Integer.parseInt(values[i].substring(0, 3)));
- cellTower.setMobileNetworkCode(Integer.parseInt(values[i].substring(3)));
+ if (values[i].length() > 3) {
+ cellTower.setMobileCountryCode(Integer.parseInt(values[i].substring(0, 3)));
+ cellTower.setMobileNetworkCode(Integer.parseInt(values[i].substring(3)));
+ }
break;
case "PC":
position.set(Position.PREFIX_COUNT + 1, Integer.parseInt(values[i]));