Skip to content

Fix NPE when cascade @Valid on nullable pojo #271

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

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

rbygrave
Copy link
Contributor

When cascading via @Valid on a related pojo that can be nullable, this can generate an NPE.

Fix is to change the generated code for pojo adapters to check for the value/pojo to be null and skip the validation in that case

When cascading via @Valid on a related pojo that can be nullable, this can generate an NPE.

Fix is to change the generated code for pojo adapters to check for the value/pojo to be null and skip the validation in that case
@rbygrave rbygrave requested a review from SentryMan January 29, 2025 08:43
@rbygrave rbygrave self-assigned this Jan 29, 2025
@SentryMan SentryMan merged commit 5cb6a2f into main Jan 29, 2025
7 checks passed
@SentryMan SentryMan deleted the feature/fix-npe-cascading-nullable branch January 29, 2025 13:37
@rbygrave rbygrave added this to the 2.6 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants