Skip to content

Commit

Permalink
v3-width height (#100)
Browse files Browse the repository at this point in the history
* targetframework now net8.0, packages upgraded

* updated gitignore to the toptotal standard, added launchSettings to help developers run the samples

* ignoring null values in json response
  • Loading branch information
quirijnslings authored Sep 16, 2024
1 parent 38a93cd commit f6791ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Bynder/Sdk/Api/RequestSender/ApiRequestSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ public async Task<T> SendRequestAsync<T>(Request<T> request)
{
return default;
}
// Note: for powerpoints, a pdf is automatically generated by Bynder and stored as a second MediaItem.
// However, this MediaItem has a Height and Width of null, which cannot be converted to an int so it breaks.
// The below setting fixes this
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
};

return JsonConvert.DeserializeObject<T>(responseString);
return JsonConvert.DeserializeObject<T>(responseString, settings);
}

private async Task<HttpResponseMessage> CreateHttpRequestAsync<T>(Request<T> request)
Expand Down

0 comments on commit f6791ce

Please sign in to comment.