diff --git a/src/t_stream.c b/src/t_stream.c index 68836bf156..ceb4950e1b 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -458,8 +458,8 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_ size_t lp_bytes = 0; /* Total bytes in the tail listpack. */ unsigned char *lp = NULL; /* Tail listpack pointer. */ - /* Get a reference to the tail node listpack. */ - if (raxNext(&ri)) { + if (!raxEOF(&ri)) { + /* Get a reference to the tail node listpack. */ lp = ri.data; lp_bytes = lpBytes(lp); }