From 0bb113203493ed4ab39b02cbabbe39f538c58651 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 --- outbound/selector.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/outbound/selector.go b/outbound/selector.go index e801daea..7326f58f 100644 --- a/outbound/selector.go +++ b/outbound/selector.go @@ -97,7 +97,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 {