aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Ev603ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Ev603ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Ev603ProtocolDecoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java
index 83689f760..6d89120a8 100644
--- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java
@@ -23,6 +23,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;
@@ -68,7 +69,12 @@ public class Ev603ProtocolDecoder extends GenericProtocolDecoder{
// Detect device ID
if (sentence.startsWith("!1,")) {
String imei = sentence.substring(3);
- deviceId = getDataManager().getDeviceByImei(imei).getId();
+ try {
+ deviceId = getDataManager().getDeviceByImei(imei).getId();
+ } catch(Exception error) {
+ Log.warning("Unknown device - " + imei);
+ return null;
+ }
}
else if (sentence.startsWith("!A,")) {