tosunthex / CoinGecko

CoinGecko .Net Standard api wrapper
111 stars 46 forks source link

Null values in the marketcap rank cause an exception in the API client. #15

Closed Damonsoft closed 4 years ago

Damonsoft commented 4 years ago

Hello! In the CoinsClient parsing any null marketcap rank values from the CoinGecko api causes an exception. This happens in both the GetCoinMarkets function and GetAllCoinDataWithID functions.

The output is:

HttpRequestException: Error converting value {null} to type 'System.Int64'. Path '[32].market_cap_rank', line 1, position 21880.

The stacktrace is:

CoinGecko.Clients.BaseApiClient.GetAsync<T>(Uri resourceUri)
CoinGecko.Clients.CoinsClient.GetCoinMarkets(string vsCurrency, string[] ids, string order, Nullable<int> perPage, Nullable<int> page, bool sparkline, string priceChangePercentage)

Some random coin IDs that cause exception are 'auxiliam', 'conun', 'paycon-token'. Thanks for your help!