Browse Source

Small fixes (#2106)

somebodywashere 11 months ago
parent
commit
43ec88bb24
2 changed files with 5 additions and 1 deletions
  1. 4 0
      sub/subService.go
  2. 1 1
      web/service/tgbot.go

+ 4 - 0
sub/subService.go

@@ -45,6 +45,10 @@ func (s *SubService) GetSubs(subId string, host string) ([]string, string, error
 		return nil, "", err
 	}
 
+	if len(inbounds) == 0 {
+		return nil, "", common.NewError("No inbounds found with ", subId)
+	}
+
 	s.datepicker, err = s.settingService.GetDatepicker()
 	if err != nil {
 		s.datepicker = "gregorian"

+ 1 - 1
web/service/tgbot.go

@@ -1469,7 +1469,7 @@ func (t *Tgbot) notifyExhausted() {
 								var disabledClients []xray.ClientTraffic
 								var exhaustedClients []xray.ClientTraffic
 								traffics, err := t.inboundService.GetClientTrafficTgBot(client.TgID)
-								if err == nil {
+								if err == nil  && len(traffics) > 0 {
 									output := t.I18nBot("tgbot.messages.exhaustedCount", "Type=="+t.I18nBot("tgbot.clients"))
 									for _, traffic := range traffics {
 										if traffic.Enable {