Skip to content

Commit 42a323c

Browse files
committed
c: unwrap_reply now correctly handles nil, err arguments
It used to eat err. Oops.
1 parent 7993db3 commit 42a323c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lua-hiredis.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ static int lhiredis_unwrap_reply(lua_State * L)
493493

494494
if (!lua_istable(L, 1))
495495
{
496+
if (lua_isnil(L, 1) && !lua_isnoneornil(L, 2))
497+
{
498+
lua_pushvalue(L, 1);
499+
lua_pushvalue(L, 2);
500+
return 2;
501+
}
502+
496503
lua_pushvalue(L, 1);
497504
return 1;
498505
}

0 commit comments

Comments
 (0)