Skip to content

Commit

Permalink
fixed bug when sending an empty list of messages to a null destination.
Browse files Browse the repository at this point in the history
  • Loading branch information
udidahan committed Dec 6, 2010
1 parent 07be8d6 commit ca1327f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/unicast/NServiceBus.Unicast/UnicastBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,13 @@ private ICallback SendMessage(string destination, string correlationId, MessageI
return null;
}

if (messages == null || messages.Length == 0)
throw new InvalidOperationException("Cannot send an empty set of messages.");

if (destination == null)
throw new InvalidOperationException(
string.Format("No destination specified for message {0}. Message cannot be sent. Check the UnicastBusConfig section in your config file and ensure that a MessageEndpointMapping exists for the message type.", messages[0].GetType().FullName));

if (messages == null || messages.Length == 0)
throw new InvalidOperationException("Cannot send an empty set of messages.");

foreach (var id in SendMessage(new List<string> { destination }, correlationId, messageIntent, messages))
{
var result = new Callback(id);
Expand Down

0 comments on commit ca1327f

Please sign in to comment.