selector: Fix crash before start

This commit is contained in:
世界 2024-11-13 13:54:31 +08:00
parent 4d9f11d5f0
commit 96dab3ba25
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -98,7 +98,11 @@ func (s *Selector) Start() error {
}
func (s *Selector) Now() string {
return s.selected.Tag()
selected := s.selected
if selected == nil {
return s.tags[0]
}
return selected.Tag()
}
func (s *Selector) All() []string {