-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Expected Behavior
I would not have to add a name, or the error message would be clearer that a parameter name was missing.
Actual Behavior
A NullReferenceException is thrown.
Steps to Reproduce the Problem
- Add a request body parameter without a name
This must be the issue in RestClient.ConfigureHttp (it's assuming the name is there):
var parameterExists =
request.Parameters.Any(p =>
p.Name.Equals(defaultParameter.Name, StringComparison.InvariantCultureIgnoreCase)
&& p.Type == defaultParameter.Type);
Specifications
- Version: 106.6.9.0
- Platform: .NET Framework
- Subsystem:
StackTrace
System.NullReferenceException: Object reference not set to an instance of an object.
at RestSharp.RestClient.<>c__DisplayClass172_0.b__8(Parameter p)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at RestSharp.RestClient.ConfigureHttp(IRestRequest request)
at RestSharp.RestClient.ExecuteAsync(IRestRequest request, Action`2 callback, String httpMethod, Func`4 getWebRequest)
at RestSharp.RestClient.ExecuteAsync(IRestRequest request, Action`2 callback, Method httpMethod)
Metadata
Metadata
Assignees
Labels
No labels