fix empty client ID on request #1182

This commit is contained in:
Alireza Ahmadi
2024-04-18 22:53:33 +02:00
parent cf9e09eaf3
commit 7258cbfc70

View File

@@ -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")
}