tosunthex / CoinGecko

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

Null Conversion Error #26

Closed baramustafa closed 3 years ago

baramustafa commented 3 years ago

Hi,

Another null error when calling: CoinsClient.GetCoinMarkets("usd");

Error converting value {null} to type 'System.DateTimeOffset'. Path '[36].ath_date', line 1, position 27442.

Thanks

tosunthex commented 3 years ago

Hi @baramustafa

Could you check it again. I think there was a problem with data because i cant get null error right now.

midas1977 commented 3 years ago

Hi Having the same issue. Tested with id binance-vnd. Another one is blackberry-token. The problem is, that the ath_date is null in the response, but your conversion in class CoinGecko.Entities.Response.Coins.CoinMarkets, property AthDate is not nullable. Not all but a few items have null values.

Example API query: https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=binance-vnd%2Cblackberry-token%2Cbitcoin&order=market_cap_desc&per_page=100&page=1&sparkline=false&price_change_percentage=24h%2C7d%2C30d%2C1y

FYI: my VS2019 C# project has the setting "Nullable" = Enable

Hope this helps.

tosunthex commented 3 years ago

hi @midas1977 @baramustafa to fix the problem, you can download the newest version from nuget