fix: validate default settings timezone on startup (#2345)

This commit is contained in:
Tink 2026-03-03 13:16:37 +01:00 committed by GitHub
parent dc009ed69d
commit 40bcf2b36f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -644,7 +644,9 @@ func InitConfig() {
MigrationMicrosoftTodoRedirectURL.Set(ServicePublicURL.GetString() + "migrate/microsoft-todo")
}
if DefaultSettingsTimezone.GetString() == "" {
if tz := DefaultSettingsTimezone.GetString(); tz == "" {
DefaultSettingsTimezone.Set(ServiceTimeZone.GetString())
} else if _, err := time.LoadLocation(tz); err != nil {
DefaultSettingsTimezone.Set(ServiceTimeZone.GetString())
}