kevbite / CompaniesHouse.NET

A simple .NET client wrapper for CompaniesHouse API
MIT License
37 stars 44 forks source link

Cannot convert null value to CompaniesHouse.Response.FilingHistoryStatus #132

Closed johnmackerras closed 4 years ago

johnmackerras commented 4 years ago

Recieved the above error when executig the GetCompanyFilingHistoryAsync for the Company number 'RS007401'

var hist = await client.GetCompanyFilingHistoryAsync("RS007401");

An unhandled exception occurred while processing the request.

JsonSerializationException: Cannot convert null value to CompaniesHouse.Response.FilingHistoryStatus. Path 'filing_history_status', line 1, position 81.

Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

kevbite commented 4 years ago

Hey @johnmackerras 👋, thanks for raising the issue, I've added a fix in to deal with null coming back from the API, this should default to a value of None.

This fix is in version 7.8.2.