Skip to content

MapValueResolver resolves present-but-null keys to null instead of UNRESOLVED - #1232

Open
mvanhorn wants to merge 1 commit into
jknack:masterfrom
mvanhorn:fix/1141-map-resolver-null-values
Open

mvanhorn wants to merge 1 commit into
jknack:masterfrom
mvanhorn:fix/1141-map-resolver-null-values

Conversation

@mvanhorn

Copy link
Copy Markdown

Background

It addresses the behavior reported in issue #1141.

Summary of the fix

fix: MapValueResolver resolves present-but-null keys to null instead of UNRESOLVED

Testing

The targeted tests for the handlebars.java MapValueResolver change pass locally. The tests in handlebars/src/test/java/com/github/jknack/handlebars/issues/Issue1141.java fail without the fix in the handlebars.java MapValueResolver change (checked by reverting the source changes). The new test handlebars/src/test/java/com/github/jknack/handlebars/issues/Issue1141.java did not run here: no test runner for it was available.

Fixes #1141

@jknack

jknack commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

I'm kind of surprise all other tests passed. I feel is going to break a lot if we merge on 4.x., I was planning to add it on 5.x which a major release.

@mvanhorn

Copy link
Copy Markdown
Author

Fair, it does change what templates see for keys that are present with a null value, so 5.x is the right place for it.

The 4.x branch is on 5.0.0-SNAPSHOT right now. Should I rebase this onto 4.x and retarget the PR there, or is there a separate 5.x branch coming that you'd rather I wait for?

@jknack

jknack commented Nov 30, 2026

Copy link
Copy Markdown
Owner

need to change the version on master. 5.x branch is not yet on github and this change is included already.

This branch has not been deployed

No deployments
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.

[Q] resolvers & null values

2 participants