-
Notifications
You must be signed in to change notification settings - Fork 101
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
Serializing null AutoValue object #28
Comments
Call .nullSafe() on the TypeAdapter before registering it. On Mon, Apr 18, 2016, 9:41 PM Nicolas Milliard notifications@github.com
|
Keep in mind it returns a new null-safe instance which needs registered, On Mon, Apr 18, 2016, 9:51 PM Jake Wharton jakewharton@gmail.com wrote:
|
Thanks @JakeWharton. I missed that useful API. |
I am converting slowly my value objects to AutoValue with Gson extension.
I am having an issue for the following case:
(Pseudo code)
When I am trying to serialize A with gson and B is null I am getting a NPE on the following line
if (object.enabled() != null)
inside $AutoValue_B:because
object
is null.The text was updated successfully, but these errors were encountered: