Closed GaryMcD closed 3 years ago
var target = string.IsNullOrWhiteSpace(jObject.Value<string>("label")) ? (IOption)new Option() : new OptionGroup();
changed to
var target = jObject.ContainsKey("label") ? new OptionGroup() : (IOption)new Option();
should solve.
Thanks for raising this @GaryMcD - this has been corrected in 2.15.1 👍
Discovered this while receiving a view response for a view that had been made with an option group, it continued to fail until I dug in to find which object was causing Newtonsoft to throw an exception. Pasted my code example below of how to cause it. This seems to be caused by
string.IsNullOrWhiteSpace(jObject.Value<string>("label"))
within theOptionConverter