Skip to content

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

Closed

Description

@yarooh

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.

Activity

  1. yarooh commented on Mar 14, 2022

    @yarooh
    Author

    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; });

  2. self-assigned this
    on Mar 28, 2022
  3. 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[/+] on Mar 31, 2022
  4. added 2 commits that reference this issue on Mar 31, 2022
    9df07ff
    c0b48f7
  5. added this to the 2.5.11 (2021.0.11) milestone on Mar 31, 2022
  6. added a commit that references this issue on Mar 31, 2022
  7. added a commit that references this issue on Apr 26, 2024
    5ce30f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions