From 7258cbfc70cb8ec9f934dd9a7a0d5631caddf90a Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Thu, 18 Apr 2024 22:53:33 +0200 Subject: [PATCH] fix empty client ID on request #1182 --- web/service/inbound.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/service/inbound.go b/web/service/inbound.go index 8fa8ce89..bbe6ac71 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -588,7 +588,7 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin oldEmail := "" newClientId := "" - clientIndex := 0 + clientIndex := -1 for index, oldClient := range oldClients { oldClientId := "" if oldInbound.Protocol == "trojan" { @@ -609,7 +609,7 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin } // Validate new client ID - if newClientId == "" { + if newClientId == "" || clientIndex == -1 { return false, common.NewError("empty client ID") }