diff options
Diffstat (limited to 'src/org/traccar/protocol/Avl08ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Avl08ProtocolDecoder.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Avl08ProtocolDecoder.java b/src/org/traccar/protocol/Avl08ProtocolDecoder.java index c8766b642..a01771c35 100644 --- a/src/org/traccar/protocol/Avl08ProtocolDecoder.java +++ b/src/org/traccar/protocol/Avl08ProtocolDecoder.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; @@ -88,7 +89,12 @@ public class Avl08ProtocolDecoder 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; + } // Alarm type extendedInfo.append("<alarm>"); |