Skip to content

Fixed primitive early return if all ref types are null#4005

Open
ronodhirSoumik wants to merge 1 commit intomapstruct:mainfrom
ronodhirSoumik:bugfix/fix-primitive-early-return
Open

Fixed primitive early return if all ref types are null#4005
ronodhirSoumik wants to merge 1 commit intomapstruct:mainfrom
ronodhirSoumik:bugfix/fix-primitive-early-return

Conversation

@ronodhirSoumik
Copy link

fixes #3992
Updated the check in the ftl file to only generate an early return-null block if every single parameter is subject to a null check. If there are parameters that don't need null checks (like primitives), keep going and map them.

@filiphr
Copy link
Member

filiphr commented Mar 21, 2026

@ronodhirSoumik the CI is failing. Can you please fix it first and then I'll go ahead and review it

@ronodhirSoumik ronodhirSoumik force-pushed the bugfix/fix-primitive-early-return branch from 5617f3a to 7cd00bd Compare March 21, 2026 18:48
@ronodhirSoumik
Copy link
Author

@ronodhirSoumik the CI is failing. Can you please fix it first and then I'll go ahead and review it

resolved

Signed-off-by: ronodhirSoumik <ronodhirsoumik@gmail.com>
@ronodhirSoumik ronodhirSoumik force-pushed the bugfix/fix-primitive-early-return branch from 7cd00bd to bccf903 Compare March 21, 2026 20:22
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.

MapStruct ignores primitive parameters when all non-primitive parameters are null due to generated null-check logic

2 participants