From 0751024a14f2053a5a0f886efe695a1a2da64c42 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 11 Feb 2008 13:00:45 +0000 Subject: Check valid listener (or handler) exist and log error if not. See QPID-783. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@620479 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/Dispatcher.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/Dispatcher.cpp b/qpid/cpp/src/qpid/client/Dispatcher.cpp index 0783d5bc55..8df4637c88 100644 --- a/qpid/cpp/src/qpid/client/Dispatcher.cpp +++ b/qpid/cpp/src/qpid/client/Dispatcher.cpp @@ -75,11 +75,18 @@ void Dispatcher::run() if (content->isA()) { 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&) { -- cgit v1.2.1