Skip to content

DefaultGeoOperations.radius(…) throws NullPointerException in pipeline mode #2279

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

Closed
yarooh opened this issue Mar 14, 2022 · 1 comment
Closed
Assignees
Labels
type: bug A general bug

Comments

@yarooh
Copy link

yarooh commented Mar 14, 2022

In LettuceConnection pipeline mode, using DefaultGeoOperations to call geo-related methods will get null, then convert the return value by calling method deserializeGeoResults will throw NPE.
To avoid NPE,check if the source is null before deserializeGeoResults conversion.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 14, 2022
@yarooh
Copy link
Author

yarooh commented Mar 14, 2022

For example:
redisTemplate.executePipelined(new SessionCallback<Void>() { @Override public Void execute(RedisOperations operations) throws DataAccessException { operations.opsForGeo().radius(key, within); return null; } });
it will fail and throw npe。
Must use RedisCallback because it doesn't do deserializeGeoResults
List<Object> geoInfos = redisTemplate.executePipeline((RedisCallback<Void>) connection -> { connection.geoCommands().geoRadius(key, within); return null; });

@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 28, 2022
@mp911de mp911de self-assigned this Mar 28, 2022
@mp911de mp911de changed the title In LettuceConnection pipeline mode, using DefaultGeoOperations to call geo-related methods will get null, then convert the return value by calling method deserializeGeoResults will throw NPE. DefaultGeoOperations.radius(…) throws NullPointerException in pipeline mode Mar 31, 2022
mp911de pushed a commit that referenced this issue Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this issue Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de added a commit that referenced this issue Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this issue Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this issue Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this issue Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this issue Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@mp911de mp911de added this to the 2.5.11 (2021.0.11) milestone Mar 31, 2022
mp911de added a commit that referenced this issue Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
3 participants