summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ErrorCheck.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-05-20 18:19:44 +0000
committerAlan Conway <aconway@apache.org>2009-05-20 18:19:44 +0000
commitb7b99eb789e893cbf0ff6bbf0b157d37d302f95f (patch)
treec18896a0f74f0b13c0b4d6f6a05e45d00a5b1ad9 /cpp/src/qpid/cluster/ErrorCheck.cpp
parent2ee35df0444e52ba7e24d8817110adbeaacb9e52 (diff)
downloadqpid-python-b7b99eb789e893cbf0ff6bbf0b157d37d302f95f.tar.gz
Add missing null body check in ErrorCheck
Make error checking optional. This is temporary until all issues with it are worked out. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@776799 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ErrorCheck.cpp')
-rw-r--r--cpp/src/qpid/cluster/ErrorCheck.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/ErrorCheck.cpp b/cpp/src/qpid/cluster/ErrorCheck.cpp
index 6132d52126..87a7bb914b 100644
--- a/cpp/src/qpid/cluster/ErrorCheck.cpp
+++ b/cpp/src/qpid/cluster/ErrorCheck.cpp
@@ -60,11 +60,9 @@ void ErrorCheck::error(Connection& c, ErrorType t, uint64_t seq, const MemberSet
void ErrorCheck::delivered(const EventFrame& e) {
if (isUnresolved()) {
- const ClusterErrorCheckBody* errorCheck =
- dynamic_cast<const ClusterErrorCheckBody*>(e.frame.getMethod());
- const ClusterConfigChangeBody* configChange =
- dynamic_cast<const ClusterConfigChangeBody*>(e.frame.getMethod());
-
+ const ClusterErrorCheckBody* errorCheck = 0;
+ if (e.frame.getBody())
+ errorCheck = dynamic_cast<const ClusterErrorCheckBody*>(e.frame.getMethod());
if (errorCheck && errorCheck->getFrameSeq() == frameSeq) { // Same error
if (errorCheck->getType() < type) { // my error is worse than his
QPID_LOG(critical, cluster << " Error " << frameSeq << " did not occur on " << e.getMemberId());
@@ -78,6 +76,9 @@ void ErrorCheck::delivered(const EventFrame& e) {
}
else {
frames.push_back(e); // Only drop matching errorCheck controls.
+ const ClusterConfigChangeBody* configChange = 0;
+ if (e.frame.getBody())
+ configChange = dynamic_cast<const ClusterConfigChangeBody*>(e.frame.getMethod());
if (configChange) {
MemberSet members(ClusterMap::decode(configChange->getCurrent()));
MemberSet result;