PlayFab / consuldotnet

.NET API for Consul (http://www.consul.io/)
Apache License 2.0
692 stars 193 forks source link

fix ConsulRequest json deserialization when propertyName is RegEx #111

Closed banshooter closed 6 years ago

banshooter commented 6 years ago

I got the following exception in our dotnet core project when connecting to Consul remote servers in our company: ArgumentNullException: Value cannot be null. Parameter name: name System.Type.GetProperty(string name, BindingFlags bindingAttr) System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(Type type, string name) Consul.KVPairConverter.ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, object existingValue) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, object existingValue, string id) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, bool checkAdditionalContent) Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader) Consul.ConsulRequest.Deserialize(Stream stream) Consul.GetRequest+d5.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Consul.KV+d13.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) System.Runtime.CompilerServices.TaskAwaiter.GetResult() WebApplication2.Controllers.ValuesController+d__0.MoveNext()