Skip to content

Commit

Permalink
Check to ensure pipeline arguments are not empty before sending.
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoe7 committed Aug 22, 2017
1 parent 805cb47 commit c7046d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toredis/client.py
Expand Up @@ -108,6 +108,11 @@ def send_messages(self, args_pipeline, callback=None):
:param callback:
Callback
"""
if not args_pipeline:
# Exit immediately if there's no pipeline commands
# Otherwise registering callback white sending empty message
# will cause callback mismatch going forward
return

if self._sub_callback is not None:
raise ValueError('Cannot run pipeline over PUBSUB connection')
Expand Down

0 comments on commit c7046d9

Please sign in to comment.