From 15174a8dc6ba9f7e0b35282cabd7b18c778c2a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Thu, 18 Sep 2025 06:42:23 +0000 Subject: [PATCH] Fix nil config provided --- app/proxyman/command/command.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go index a86f0921..5ec8ea11 100644 --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -71,6 +71,9 @@ type handlerServer struct { } func (s *handlerServer) AddInbound(ctx context.Context, request *AddInboundRequest) (*AddInboundResponse, error) { + if request.Inbound == nil { + return nil, errors.New("inbound config is nil") + } if err := core.AddInboundHandler(s.s, request.Inbound); err != nil { return nil, err } @@ -163,6 +166,9 @@ func (s *handlerServer) GetInboundUsersCount(ctx context.Context, request *GetIn } func (s *handlerServer) AddOutbound(ctx context.Context, request *AddOutboundRequest) (*AddOutboundResponse, error) { + if request.Outbound == nil { + return nil, errors.New("outbound config is nil") + } if err := core.AddOutboundHandler(s.s, request.Outbound); err != nil { return nil, err }