Skip to content

Commit

Permalink
fix empty client ID on request #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Apr 18, 2024
1 parent cf9e09e commit 7258cbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/service/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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")
}

Expand Down

0 comments on commit 7258cbf

Please sign in to comment.