mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 01:21: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 ZoneRules zoneRules = zoneId.getRules();
|
||||||
final Instant now = Instant.now();
|
final Instant now = Instant.now();
|
||||||
final ZoneOffsetTransition transition = zoneRules.nextTransition(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 nextDstMillis = transition.getInstant().toEpochMilli();
|
||||||
final long delayMillis = nextDstMillis - now.toEpochMilli() + 5000L;
|
final long delayMillis = nextDstMillis - now.toEpochMilli() + 5000L;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user