Avoid potential comparison of value type with null.

While there aren't currently any cases where the generic type is a value
type, this will make the code slightly more robust to future
implementations.
This commit is contained in:
Kenneth Hsu
2018-10-07 09:59:13 -07:00
parent 439e319061
commit ecb670a2d9
@@ -498,7 +498,7 @@ namespace Duplicati.Library.Backend
private T SendRequest<T>(HttpMethod method, string url, T body)
{
var request = new HttpRequestMessage(method, url);
if (body != null)
if (!Object.Equals(body, default(T)))
{
request.Content = this.PrepareContent(body);
}