fix: handle empty AI500 coin list gracefully instead of error

This commit is contained in:
tinkle-community
2026-01-23 20:12:11 +08:00
parent 2f54d1d4c0
commit b5716ff3cb
3 changed files with 11 additions and 1 deletions

View File

@@ -73,8 +73,10 @@ func (c *Client) fetchAI500() ([]CoinData, error) {
return nil, fmt.Errorf("API returned failure status")
}
// 空列表是正常情况,不是错误
if len(response.Data.Coins) == 0 {
return nil, fmt.Errorf("coin list is empty")
log.Printf(" AI500 returned empty coin list (no coins meet criteria currently)")
return []CoinData{}, nil
}
// Set IsAvailable flag