Skip to content
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

BZPOPMIN & BZPOPMAX throws NPE when sorted set is empty #3928

Closed
JW-Vinay opened this issue Aug 21, 2024 · 0 comments · Fixed by #3930
Closed

BZPOPMIN & BZPOPMAX throws NPE when sorted set is empty #3928

JW-Vinay opened this issue Aug 21, 2024 · 0 comments · Fixed by #3930
Labels
Milestone

Comments

@JW-Vinay
Copy link

Expected behavior

BZPOPMIN & BZPOPMAX should return null when the key doesn't exist

Actual behavior

Throws an NPE when the key does not exist
StackTrace

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "l" is null
	at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:599)
	at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:594)
	at redis.clients.jedis.Connection.executeCommand(Connection.java:141)
	at redis.clients.jedis.Jedis.bzpopmin(Jedis.java:7144)
	at com.yext.dataingestion.source.scripts.JedisScriptTesting.test(JedisScriptTesting.java:154)
	at com.yext.dataingestion.source.scripts.JedisScriptTesting.main(JedisScriptTesting.java:137)

Steps to reproduce:

void test() {
  var pool = new JedisSentinelPool("<master>", sentinels, poolConfig, Protocol.DEFAULT_TIMEOUT);
  var jedis = pool.getResource();
  var r = jedis.bzpopmin(0.2, "test"); // throws NPE
}

Redis / Jedis Configuration

Jedis version:

Jedis 5.1.4

Redis version:

7.0.12

Java version:

Java -17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants