diff options
Diffstat (limited to 'src/org/traccar/protocol/Pt502ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Pt502ProtocolDecoder.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index b08b6c1bd..e5f2e9224 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -80,7 +80,12 @@ public class Pt502ProtocolDecoder extends GenericProtocolDecoder { // Get device by IMEI
String id = parser.group(index++);
- position.setDeviceId(getDataManager().getDeviceByImei(id).getId());
+ try {
+ position.setDeviceId(getDataManager().getDeviceByImei(id).getId());
+ } catch(Exception error) {
+ Log.warning("Unknown device - " + id);
+ return null;
+ }
// Time
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|