You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DefaultGeoOperations.radius(…) throws NullPointerException in pipeline mode #2279
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.
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; });
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
Activity
yarooh commentedon 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; });[-]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[/+]Eagerly return `null` values in `AbstractOperations.deserializeGeoRes…
Polishing.
Polishing.
Eagerly return `null` values in `AbstractOperations.deserializeGeoRes…
Polishing.
Eagerly return `null` values in `AbstractOperations.deserializeGeoRes…
Polishing.
Polishing.
Eagerly return `null` values in `AbstractOperations.deserializeGeoRes…