-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the value
is null the SerializeObject
will throw NullReferenceException
#248
Comments
The serialization should does not handle null checks at the moment since it is deferring the usage to the caller. But thanks for mentioning this, I can put a null check in place to avoid the exception. |
@Mutuduxf , I have pushed the changes to version 1.4.4. Please test again and reopen if it is still an issue. Thanks |
Hi, @rpgmaker , Thanks for your great work. I upgraded to 1.4.4 and tested it, but something interesting has happened. The new code can pass in Net Core, but Framework 4.8 cannot. I have decompiled the dll file from the nuget package (version 1.4.4, net 6.0) and found that there is no new code in it (but it can pass the test in net core!). |
That is strange. I wonder if I did not copy the assembly correctly from my machine. I will check it tomorrow. Thanks |
Because
SerializeObject
is merely a wrapper aroundSerialize
, the type information is obtained by callingvalue.GetType()
. This is not how json serializers are typically used. (Perhaps I do not have enough experience.)The text was updated successfully, but these errors were encountered: