Skip to content

Commit

Permalink
Fix RedisTransactioner: handle empty deque
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluo-msft committed Jan 2, 2021
1 parent 624e0b8 commit 6d1d33b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion common/redistran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,21 @@ void RedisTransactioner::enqueue(const std::string &command, int expectedType)

redisReply *RedisTransactioner::dequeueReply()
{
if (m_results.empty())
{
return NULL;
}
redisReply *ret = m_results.front();
m_results.pop_front();
return ret;
}

void RedisTransactioner::clearResults()
{
if (m_results.empty()) return;
if (m_results.empty())
{
return;
}
for (const auto& r: m_results)
{
freeReplyObject(r);
Expand Down

0 comments on commit 6d1d33b

Please sign in to comment.