summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/broker/src/Channel.cpp2
-rw-r--r--cpp/broker/test/ChannelTest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/cpp/broker/src/Channel.cpp b/cpp/broker/src/Channel.cpp
index 7bc6d599e9..34d69716c4 100644
--- a/cpp/broker/src/Channel.cpp
+++ b/cpp/broker/src/Channel.cpp
@@ -124,7 +124,7 @@ Channel::ConsumerImpl::ConsumerImpl(Channel* _parent, string& _tag,
}
bool Channel::ConsumerImpl::deliver(Message::shared_ptr& msg){
- if(connection != msg->getPublisher()){//check for no_local
+ if(!connection || connection != msg->getPublisher()){//check for no_local
if(ackExpected && !parent->checkPrefetch(msg)){
blocked = true;
}else{
diff --git a/cpp/broker/test/ChannelTest.cpp b/cpp/broker/test/ChannelTest.cpp
index 45498989f2..001a0d9c00 100644
--- a/cpp/broker/test/ChannelTest.cpp
+++ b/cpp/broker/test/ChannelTest.cpp
@@ -108,7 +108,7 @@ class ChannelTest : public CppUnit::TestCase
msg->addContent(body);
Queue::shared_ptr queue(new Queue("my_queue"));
- ConnectionToken* owner;
+ ConnectionToken* owner(0);
string tag("no_ack");
channel.consume(tag, queue, false, false, owner);