mirror of https://github.com/apache/activemq.git
Throw an InvalidDestinationException early on if the topic is null for better JMS compliance.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1420820 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
44a7ffa946
commit
aaead5be21
|
@ -1292,6 +1292,10 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
||||||
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException {
|
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException {
|
||||||
checkClosed();
|
checkClosed();
|
||||||
|
|
||||||
|
if (topic == null) {
|
||||||
|
throw new InvalidDestinationException("Topic cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
if (isIndividualAcknowledge()) {
|
if (isIndividualAcknowledge()) {
|
||||||
throw JMSExceptionSupport.create("Cannot create a durable consumer for a Session in "+
|
throw JMSExceptionSupport.create("Cannot create a durable consumer for a Session in "+
|
||||||
"INDIVIDUAL_ACKNOWLEDGE mode.", null);
|
"INDIVIDUAL_ACKNOWLEDGE mode.", null);
|
||||||
|
|
Loading…
Reference in New Issue