diff options
| author | Gordon Sim <gsim@apache.org> | 2013-10-24 16:14:49 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-10-24 16:14:49 +0000 |
| commit | ae2fa917369c8b0896c891425df0db31fe8eeaeb (patch) | |
| tree | 25930a3a9309aa114efcb1f808569f2d15859e13 /cpp/src/qpid/messaging/MessageImpl.cpp | |
| parent | 61c797143d41fbc78249047f8c596219560ea090 (diff) | |
| download | qpid-python-ae2fa917369c8b0896c891425df0db31fe8eeaeb.tar.gz | |
QPID-5256: check type before assuming it is string
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1535427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging/MessageImpl.cpp')
| -rw-r--r-- | cpp/src/qpid/messaging/MessageImpl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/src/qpid/messaging/MessageImpl.cpp b/cpp/src/qpid/messaging/MessageImpl.cpp index e9232804d8..620e48ec2e 100644 --- a/cpp/src/qpid/messaging/MessageImpl.cpp +++ b/cpp/src/qpid/messaging/MessageImpl.cpp @@ -196,13 +196,13 @@ const std::string& MessageImpl::getBytes() const encoded->getBody(bytes, content); contentDecoded = true; } - if (bytes.empty() && !content.isVoid()) return content.getString(); + if (bytes.empty() && content.getType() == VAR_STRING) return content.getString(); else return bytes; } std::string& MessageImpl::getBytes() { updated();//have to assume body may be edited, invalidating our message - if (bytes.empty() && !content.isVoid()) return content.getString(); + if (bytes.empty() && content.getType() == VAR_STRING) return content.getString(); else return bytes; } |
