Skip to content

Commit

Permalink
check null parameter on sebd request
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossein committed Apr 10, 2023
1 parent 66b37c7 commit a62cb4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kavenegar.Core/KavenegarApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ private string GetApiPath(string _base, string method, string output)
private async Task<string> Execute(string path, Dictionary<string, object> _params)
{
var nvc = _params?.Select(x => new KeyValuePair<string, string>(x.Key, x.Value?.ToString()));

var postdata = new FormUrlEncodedContent(nvc);
var postdata = nvc != null ? new FormUrlEncodedContent(nvc):null;

var response = await _client.PostAsync(path, postdata);
var responseBody = await response.Content.ReadAsStringAsync();
Expand Down

0 comments on commit a62cb4c

Please sign in to comment.