mirror of https://github.com/valkey-io/valkey
Fix XREAD returning error on empty stream with + ID
When using XREAD STREAMS <stream> + on an empty stream created with MKSTREAM, valkey returns an error instead of nil. This heppens because is missing a check on the stream length The fix adds the lenght check on the condition Fixes #2728 Signed-off-by: diego-ciciani01 <diego.ciciani@gmail.com>
This commit is contained in:
parent
981b8fe1bd
commit
bf4488d67c
|
|
@ -2275,7 +2275,7 @@ void xreadCommand(client *c) {
|
|||
"just return an empty result set.");
|
||||
goto cleanup;
|
||||
}
|
||||
if (o) {
|
||||
if (o && ((stream *)o->ptr)->length) {
|
||||
stream *s = o->ptr;
|
||||
ids[id_idx] = s->last_id;
|
||||
if (streamDecrID(&ids[id_idx]) != C_OK) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue