Fix crash in ApiEvents::CheckResultAPIHandler

fixes #7577
This commit is contained in:
Gunnar Beutner 2014-11-05 09:58:43 +01:00
parent ad14ff6d6b
commit 18d317faf9
1 changed files with 11 additions and 9 deletions

View File

@ -144,16 +144,18 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
Array::Ptr rperf = make_shared<Array>();
ObjectLock olock(vperf);
BOOST_FOREACH(const Value& vp, vperf) {
Value p;
if (vperf) {
ObjectLock olock(vperf);
BOOST_FOREACH(const Value& vp, vperf) {
Value p;
if (vp.IsObjectType<Dictionary>()) {
PerfdataValue::Ptr val = make_shared<PerfdataValue>();
Deserialize(val, vp, true);
rperf->Add(val);
} else
rperf->Add(vp);
if (vp.IsObjectType<Dictionary>()) {
PerfdataValue::Ptr val = make_shared<PerfdataValue>();
Deserialize(val, vp, true);
rperf->Add(val);
} else
rperf->Add(vp);
}
}
cr->SetPerformanceData(rperf);