added an explicit check that the destination is not null to prevent cryptic exception messages from the broker

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@452507 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-10-03 14:26:38 +00:00
parent 8d42a5af7f
commit 4e1ec02590
1 changed files with 3 additions and 0 deletions

View File

@ -458,6 +458,9 @@ public class ActiveMQMessageProducer implements MessageProducer, StatsCapable, C
} else { } else {
throw new UnsupportedOperationException("This producer can only send messages to: " + this.info.getDestination().getPhysicalName()); throw new UnsupportedOperationException("This producer can only send messages to: " + this.info.getDestination().getPhysicalName());
} }
if (dest == null) {
throw new JMSException("No destination specified");
}
this.session.send(this, dest, message, deliveryMode, priority, timeToLive); this.session.send(this, dest, message, deliveryMode, priority, timeToLive);
stats.onMessage(); stats.onMessage();