From 96dab3ba25be3978caf9a87b6853ca191fbf07e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 13 Nov 2024 13:54:31 +0800 Subject: [PATCH] selector: Fix crash before start --- protocol/group/selector.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/group/selector.go b/protocol/group/selector.go index dc0b7cce..08db74c0 100644 --- a/protocol/group/selector.go +++ b/protocol/group/selector.go @@ -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 {