rpgmaker / NetJSON

Faster than Any Binary? Benchmark: http://theburningmonk.com/2014/08/json-serializers-benchmarks-updated-2/
MIT License
231 stars 29 forks source link

When deserialize null result it throw "Input is not a valid JSON". #247

Closed Mutuduxf closed 9 months ago

Mutuduxf commented 1 year ago

The code like this:

TestModel? nullModel = null;
var json = NetJSON.NetJSON.Serialize(nullModel, NetJSONSettings.CurrentSettings); // The serialize result is "null" 
var result = NetJSON.NetJSON.Deserialize<TestModel>(json); // Throw "Input is not a valid JSON."
rpgmaker commented 1 year ago

Thanks. Will look into it

rpgmaker commented 9 months ago

I have fixed the issue. It was failing because it was checking the character for { and ] and explicit "null" string was causing the failure. I will push it as part of the next update later.

rpgmaker commented 9 months ago

@Mutuduxf , I have pushed the changes to version 1.4.4. Please test again and reopen if it is still an issue. Thanks