From 0c43fda86d829563f425f25eec6a82e35b251aef Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 11 Jul 2022 23:08:59 +0900 Subject: [PATCH] Prevent stackoverflow exception when ripio is unavailable --- BTCPayServer.Rating/Providers/RipioExchangeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/BTCPayServer.Rating/Providers/RipioExchangeProvider.cs b/BTCPayServer.Rating/Providers/RipioExchangeProvider.cs index 3294f40d6..2647dec3a 100644 --- a/BTCPayServer.Rating/Providers/RipioExchangeProvider.cs +++ b/BTCPayServer.Rating/Providers/RipioExchangeProvider.cs @@ -21,6 +21,7 @@ namespace BTCPayServer.Services.Rates public async Task 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(cancellationToken)); return jarray .Children()