diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java index 7ab2f37f0f..8d733c42ed 100755 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java @@ -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 { checkClosed(); + if (topic == null) { + throw new InvalidDestinationException("Topic cannot be null"); + } + if (isIndividualAcknowledge()) { throw JMSExceptionSupport.create("Cannot create a durable consumer for a Session in "+ "INDIVIDUAL_ACKNOWLEDGE mode.", null);