summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 0783d5bc55..8df4637c88 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -75,11 +75,18 @@ void Dispatcher::run()
if (content->isA<MessageTransferBody>()) {
Message msg(*content, session);
Subscriber::shared_ptr listener = find(msg.getDestination());
- assert(listener);
- listener->received(msg);
+ if (!listener) {
+ QPID_LOG(error, "No listener found for destination " << msg.getDestination());
+ } else {
+ assert(listener);
+ listener->received(msg);
+ }
} else {
- assert (handler.get());
- handler->handle(*content);
+ if (handler.get()) {
+ handler->handle(*content);
+ } else {
+ QPID_LOG(error, "No handler found for " << *(content->getMethod()));
+ }
}
}
} catch (const ClosedException&) {