aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tk103ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Tk103ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index 4c0fd0c03..7145cf893 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.GenericProtocolDecoder;
+import org.traccar.helper.Log;
import org.traccar.model.DataManager;
import org.traccar.model.Position;
@@ -83,7 +84,12 @@ public class Tk103ProtocolDecoder extends GenericProtocolDecoder {
// Get device by IMEI
String imei = parser.group(index++);
- position.setDeviceId(getDataManager().getDeviceByImei(imei).getId());
+ try {
+ position.setDeviceId(getDataManager().getDeviceByImei(imei).getId());
+ } catch(Exception error) {
+ Log.warning("Unknown device - " + imei);
+ return null;
+ }
// Date
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));