Prevent stackoverflow exception when ripio is unavailable

This commit is contained in:
nicolas.dorier 2022-07-11 23:08:59 +09:00
parent a64b8fb310
commit 0c43fda86d
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -21,6 +21,7 @@ namespace BTCPayServer.Services.Rates
public async Task<PairRate[]> GetRatesAsync(CancellationToken cancellationToken)
{
var response = await _httpClient.GetAsync("https://api.exchange.ripio.com/api/v1/rate/all/", cancellationToken);
response.EnsureSuccessStatusCode();
var jarray = (JArray)(await response.Content.ReadAsAsync<JArray>(cancellationToken));
return jarray
.Children<JObject>()