aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/BaseProtocolDecoder.java7
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) {