aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Goos <kevin.goos@infrabel.be>2018-03-16 12:13:02 +0100
committerKevin Goos <kevin.goos@infrabel.be>2018-03-16 12:13:02 +0100
commit901c331745c8aed5593ca80f3faff5ee4d06d2a8 (patch)
tree644232982eb111a0a50dea802a57c30784eb7832 /src
parent9c13bf44cd83c3d2489b763a6c5af6d04d26ad48 (diff)
downloadtrackermap-server-901c331745c8aed5593ca80f3faff5ee4d06d2a8.tar.gz
trackermap-server-901c331745c8aed5593ca80f3faff5ee4d06d2a8.tar.bz2
trackermap-server-901c331745c8aed5593ca80f3faff5ee4d06d2a8.zip
Added null check
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java b/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java
index 0d3995144..dc169c668 100644
--- a/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java
+++ b/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java
@@ -118,8 +118,9 @@ public class LaipacSFKamelProtocolDecoder extends BaseProtocolDecoder {
checksum = parser.next();
}
+
String result = sentence.replaceAll("^\\$(.*)\\*[0-9a-fA-F]{2}$", "$1");
- if (Integer.parseInt(checksum, 16) != Checksum.xor(result))
+ if (checksum == null || Integer.parseInt(checksum, 16) != Checksum.xor(result))
{
return null;
}