mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fix crash when timezone has no next DST transition
This commit is contained in:
parent
7420899bb9
commit
50c474e9ef
@ -89,6 +89,11 @@ public class TimeChangeReceiver extends BroadcastReceiver {
|
||||
final ZoneRules zoneRules = zoneId.getRules();
|
||||
final Instant now = Instant.now();
|
||||
final ZoneOffsetTransition transition = zoneRules.nextTransition(now);
|
||||
if (transition == null) {
|
||||
LOG.warn("No DST transition found for {}", zoneId);
|
||||
return;
|
||||
}
|
||||
|
||||
final long nextDstMillis = transition.getInstant().toEpochMilli();
|
||||
final long delayMillis = nextDstMillis - now.toEpochMilli() + 5000L;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user