summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ErrorCheck.cpp
diff options
context:
space:
mode:
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;