Skip to content

Commit ac37a62

Browse files
committed
Fix: Null object reference could be reached if there was no request data specified
1 parent c852fc3 commit ac37a62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Postgrest/Table.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ internal string GenerateUrl()
501501
/// <returns></returns>
502502
internal object PrepareRequestData(object data)
503503
{
504+
if (data == null) return new Dictionary<string, string>();
505+
504506
// Check if data is a Collection for the Insert Bulk case
505507
if (data is ICollection<T>)
506508
return JsonConvert.DeserializeObject<ICollection<T>>(JsonConvert.SerializeObject(data, Client.Instance.SerializerSettings));

0 commit comments

Comments
 (0)