From 0a26b8c9543e066a19c8b457f41425972eb0b0c4 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 31 Jul 2009 18:40:07 +0000 Subject: Make AMQFrame::getMethod() safe on frames with no body. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@799686 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/AMQFrame.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/framing/AMQFrame.h b/cpp/src/qpid/framing/AMQFrame.h index cae506fc06..29e368b671 100644 --- a/cpp/src/qpid/framing/AMQFrame.h +++ b/cpp/src/qpid/framing/AMQFrame.h @@ -46,8 +46,8 @@ class AMQFrame : public AMQDataBlock QPID_COMMON_EXTERN AMQBody* getBody(); QPID_COMMON_EXTERN const AMQBody* getBody() const; - AMQMethodBody* getMethod() { return getBody()->getMethod(); } - const AMQMethodBody* getMethod() const { return getBody()->getMethod(); } + AMQMethodBody* getMethod() { return getBody() ? getBody()->getMethod() : 0; } + const AMQMethodBody* getMethod() const { return getBody() ? getBody()->getMethod() : 0; } void setMethod(ClassId c, MethodId m); -- cgit v1.2.1