Skip to content

Commit d3ff42f

Browse files
authored
check all optional cases for a null reply
1 parent b081667 commit d3ff42f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rmutil/test_util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
#define RMUtil_Assert(expr) if (!(expr)) { fprintf (stderr, "Assertion '%s' Failed\n", __STRING(expr)); return REDISMODULE_ERR; }
2121

22-
#define RMUtil_AssertNullReply(rep) RMUtil_Assert(RedisModule_CreateStringFromCallReply(rep) == NULL)
22+
#define RMUtil_AssertNullReply(rep) RMUtil_Assert( \
23+
RedisModule_CallReplyType(rep) == REDISMODULE_REPLY_NULL || RedisModule_CreateStringFromCallReply(rep) == NULL)
2324

2425
#define RMUtil_AssertReplyEquals(rep, cstr) RMUtil_Assert( \
2526
RMUtil_StringEquals(RedisModule_CreateStringFromCallReply(rep), RedisModule_CreateString(ctx, cstr, strlen(cstr))) \

0 commit comments

Comments
 (0)