Skip to content

Fix GEODIST destination argument validation - #3934

Merged
a-TODO-rov merged 2 commits into
redis:mainfrom
codingkiddo:fix/geodist-null-to-validation
Oct 5, 2026
Merged

a-TODO-rov merged 2 commits into
redis:mainfrom
codingkiddo:fix/geodist-null-to-validation

Conversation

@codingkiddo

@codingkiddo codingkiddo commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fix GEODIST destination argument validation

RedisCommandBuilder.geodist() checks from twice, allowing a null
to argument to bypass the intended validation.

Replace the second check with to and add regression tests verifying
that null source and destination arguments produce the appropriate
IllegalArgumentException messages.

Validation:

  • mvn test -Dtest=RedisCommandBuilderUnitTests

Note

Low Risk
One-line validation fix in command construction; behavior change only rejects previously accepted null to arguments earlier.

Overview
Fixes a copy-paste bug in RedisCommandBuilder.geodist() where the second null check validated from again instead of to, so a null destination member could reach Redis instead of failing fast with IllegalArgumentException.

Adds RedisCommandBuilderUnitTests coverage asserting null from and null to each throw with messages "From must not be null" and "To must not be null".

Reviewed by Cursor Bugbot for commit fe3ebd6. Bugbot is set up for automated code reviews on this repo. Configure here.

@a-TODO-rov
a-TODO-rov merged commit 2a92d08 into redis:main Oct 5, 2026
11 checks passed
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

⌂ 换网址