diff options
author | Anton Tananaev <anton@traccar.org> | 2023-11-23 13:30:04 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-11-23 13:30:04 -0800 |
commit | e40b26908c32560c06c9fe47e9ab42f15054c586 (patch) | |
tree | 6092b4212dc3a3fe5012a8202f96a1e5fd5668c7 | |
parent | b611af130271182c8e9de924a33f172ee4431a93 (diff) | |
download | trackermap-server-e40b26908c32560c06c9fe47e9ab42f15054c586.tar.gz trackermap-server-e40b26908c32560c06c9fe47e9ab42f15054c586.tar.bz2 trackermap-server-e40b26908c32560c06c9fe47e9ab42f15054c586.zip |
Support null timezone
-rw-r--r-- | src/main/java/org/traccar/BaseProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/BaseProtocolDecoder.java b/src/main/java/org/traccar/BaseProtocolDecoder.java index 69ca0ccc6..97762e8ca 100644 --- a/src/main/java/org/traccar/BaseProtocolDecoder.java +++ b/src/main/java/org/traccar/BaseProtocolDecoder.java @@ -125,12 +125,13 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } protected TimeZone getTimeZone(long deviceId, String defaultTimeZone) { - TimeZone result = TimeZone.getTimeZone(defaultTimeZone); String timeZoneName = AttributeUtil.lookup(cacheManager, Keys.DECODER_TIMEZONE, deviceId); if (timeZoneName != null) { - result = TimeZone.getTimeZone(timeZoneName); + return TimeZone.getTimeZone(timeZoneName); + } else if (defaultTimeZone != null) { + return TimeZone.getTimeZone(defaultTimeZone); } - return result; + return null; } public DeviceSession getDeviceSession(Channel channel, SocketAddress remoteAddress, String... uniqueIds) { |