Automatic country detection commonly panics #16
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaroheinonen/my-spotify-playlist-sorter-go#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GetDeviceCountry()treats the final component of an IANA timezone as a national capital. It then dereferences the country lookup result without checking fornil.Timezones whose representative city is not a capital, such as
America/New_YorkorAmerica/Chicago, therefore panic. Both CLI and TUI flows use this function when the country field is omitted.This was reproduced with
time.Localset toAmerica/New_York;GetByCapital("New_York")returnedniland the.Alpha2access panicked.