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 | 94d8a5c36b058b76d3e61db7d2028e395b0f2b44 (patch) | |
| tree | 9ca17cd1b628a99de7925f73fe85b2927e44ee77 /qpid/cpp | |
| parent | e6b294484fc040bec1a47826df124603287dab2d (diff) | |
| download | qpid-python-94d8a5c36b058b76d3e61db7d2028e395b0f2b44.tar.gz | |
QPID-5256: check type before assuming it is string
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1535427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/messaging/MessageImpl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/messaging/MessageImpl.cpp b/qpid/cpp/src/qpid/messaging/MessageImpl.cpp index e9232804d8..620e48ec2e 100644 --- a/qpid/cpp/src/qpid/messaging/MessageImpl.cpp +++ b/qpid/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; } |
