aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-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();