mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-10-31 20:32:52 +00:00 
			
		
		
		
	[bug] avoid empty inbound
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
		
							parent
							
								
									2463b99479
								
							
						
					
					
						commit
						979fdedbbe
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -317,7 +317,6 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound, | |||
| 		oldInbound.Tag = fmt.Sprintf("inbound-%v:%v", inbound.Listen, inbound.Port) | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
| 	needRestart := false | ||||
| 	s.xrayApi.Init(p.GetAPIPort()) | ||||
| 	if s.xrayApi.DelInbound(tag) == nil { | ||||
|  | @ -509,6 +508,10 @@ func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool, | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if len(newClients) == 0 { | ||||
| 		return false, common.NewError("no client remained in Inbound") | ||||
| 	} | ||||
| 
 | ||||
| 	settings["clients"] = newClients | ||||
| 	newSettings, err := json.MarshalIndent(settings, "", "  ") | ||||
| 	if err != nil { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 MHSanaei
						MHSanaei