aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MaxonProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/MaxonProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MaxonProtocolDecoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java
index e05ef0e30..9bad2c965 100644
--- a/src/org/traccar/protocol/MaxonProtocolDecoder.java
+++ b/src/org/traccar/protocol/MaxonProtocolDecoder.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;
@@ -142,7 +143,12 @@ public class MaxonProtocolDecoder extends GenericProtocolDecoder {
if (parser.matches()) {
String imei = parser.group(1);
- position.setDeviceId(getDataManager().getDeviceByImei(imei).getId());
+ try {
+ position.setDeviceId(getDataManager().getDeviceByImei(imei).getId());
+ } catch(Exception error) {
+ Log.warning("Unknown device - " + imei);
+ return null;
+ }
return position;
}
}