fix(outbound): return early if there are no messages to be sent
This commit is contained in:
parent
ff7282ea3b
commit
daabd385c2
|
@ -31,10 +31,13 @@ def send(messages):
|
|||
else:
|
||||
messages = list(messages)
|
||||
|
||||
if len(messages) == 0:
|
||||
return
|
||||
|
||||
sent_messages = 0
|
||||
for message in sender.send(messages):
|
||||
sent_messages += 1
|
||||
yield message
|
||||
|
||||
if sent_messages == 0 and len(messages) > 0:
|
||||
if sent_messages == 0:
|
||||
raise OutboundMessageError("no messages have been sent")
|
||||
|
|
Loading…
Reference in New Issue