pipedrive-dotnet icon indicating copy to clipboard operation
pipedrive-dotnet copied to clipboard

Subscription.GetByDealId trows NullReferenceException if the Subscription not Exist

Open SergeBerwert opened this issue 2 years ago • 0 comments

When I call GetByDealId the library throws NullReferenceException if there is no Subscription

var res = await client.Subscription.GetByDealId(65);

The HttpRespons code is No content.

public async Task<T> Get<T>(Uri uri, IDictionary<string, string> parameters)
{
    Ensure.ArgumentNotNull(uri, nameof(uri));

    var response = await Connection.Get<JsonResponse<T>>(uri, parameters, null).ConfigureAwait(false);
    return response.Body.Data;
}

Body is in this case null which causes the error when it trys to access .Data

SergeBerwert avatar May 02 '22 16:05 SergeBerwert