aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-27 08:37:44 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-27 08:37:44 -0700
commit706de3e02cde8daa0bce29dd2ff96703f17ff92a (patch)
treeb5455e9711f33033e811c2e18868075d57bcea7f /src
parentfe3d9995cceb2f1530a7c2549ae9a4cf457cb7f0 (diff)
downloadtrackermap-server-706de3e02cde8daa0bce29dd2ff96703f17ff92a.tar.gz
trackermap-server-706de3e02cde8daa0bce29dd2ff96703f17ff92a.tar.bz2
trackermap-server-706de3e02cde8daa0bce29dd2ff96703f17ff92a.zip
Better PID decoding error
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/CastelProtocolDecoder.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java b/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java
index c2b740c4c..4aa65245b 100644
--- a/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java
@@ -160,6 +160,9 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
for (int i = 0; i < count; i++) {
int value;
+ if (!PID_LENGTH_MAP.containsKey(pids[i])) {
+ throw new RuntimeException(String.format("Unknown PID 0x%02x", pids[i]));
+ }
switch (PID_LENGTH_MAP.get(pids[i])) {
case 1:
value = buf.readUnsignedByte();