Skip to content
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

fix(serialization): preventing NPE when Customer.moipAccount is null during serialization to String(Json) #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fzoro
Copy link

@fzoro fzoro commented Feb 25, 2019

Serialization with jackson fails when moipAccount field is null.

Kotlin code to reproduce the issue.

    // all fields null(which is ok)
    val c = Customer()
    val objectMapper = ObjectMapper()
    objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
    val json = objectMapper.writeValueAsString(c) // throws NPE, since it evaluates all fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant