diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-06-12 11:30:41 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-06-12 11:30:41 -0700 |
commit | 1580ad6d6e2fd20ba75438163b8c3eb65f62f174 (patch) | |
tree | ba71f0a8794b4ca93580e9aa7daff462e3f85bdd /src/main | |
parent | b0786045260de09048212a6dae8e5c11f23f6813 (diff) | |
download | traccar-server-1580ad6d6e2fd20ba75438163b8c3eb65f62f174.tar.gz traccar-server-1580ad6d6e2fd20ba75438163b8c3eb65f62f174.tar.bz2 traccar-server-1580ad6d6e2fd20ba75438163b8c3eb65f62f174.zip |
Fix tests
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/protocol/UproProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java index 05e6fd811..9f236a7e5 100644 --- a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java @@ -307,7 +307,9 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { } break; case 'b': - position.set("serial", data.toString(StandardCharsets.US_ASCII).substring(3)); + if (data.readableBytes() > 3) { + position.set("serial", data.toString(StandardCharsets.US_ASCII).substring(3)); + } break; default: break; |