Skip to content

Commit

Permalink
Merge branch 'bug/error-when-job-list-empty' of https://github.com/vi…
Browse files Browse the repository at this point in the history
…nce94320/crystal-redis into vince94320-bug/error-when-job-list-empty
  • Loading branch information
Stefan Wille committed Jan 4, 2020
2 parents f6c13b9 + acfa599 commit 6de38fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/redis_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ describe Redis do
redis.del("myotherlist")
redis.rpush("mylist", "hello", "world")
redis.brpop(["myotherlist", "mylist"], 1).should eq(["mylist", "world"])

redis.del("mylist")
redis.brpop(["mylist"], 1).should eq([] of String)
end

it "#rpoplpush" do
Expand Down
2 changes: 1 addition & 1 deletion src/redis/commands.cr
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ class Redis
q << timeout_in_seconds.to_s
result = array_or_nil_command(q)

return result unless result
return result if result.nil? || result.empty?

result[0] = without_namespace("#{result.first}")
result
Expand Down

0 comments on commit 6de38fb

Please sign in to comment.