Skip to content

Unable to retrieve company list if response contains a company with a Null integrations value. #1

@keithmangan

Description

@keithmangan

Describe the bug
Unable to return a list of Companies Getting error "Response could not be deserialized to JSON"
Here is a a copy of the inner stack trace I think is relevant to the bug.

 System.AggregateException: One or more errors occurred. (Response could not be deserialized to JSON: GET https://RemovedURL/api/v1/companies?page=1)
 ---> Flurl.Http.FlurlParsingException: Response could not be deserialized to JSON: GET https:///RemovedURL/api/v1/companies?page=1
 ---> Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Int32'. Path 'companies[1].integrations[0].sync_id', line 1, position 1752.
 ---> System.InvalidCastException: Null object cannot be converted to a value type.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   --- End of inner exception stack trace ---

To Reproduce
Steps to reproduce the behavior:
I just did a very simple test of Get Companies Method only passing the parameter of page 1.
I think the issue is when there is a company in the result set with a Null integrations dataset.

Expected behavior
The Get Companies Method should Return the First page of companies when passing the parameter page with a value of 1

Desktop (please complete the following information):

  • OS: Windows server 2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions