Fix crash in IdoCheckTask::ScriptFunc

refs #11014
This commit is contained in:
Gunnar Beutner 2016-02-02 12:03:12 +01:00
parent 532655d482
commit f234bdd321
1 changed files with 7 additions and 0 deletions

View File

@ -92,6 +92,13 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
DbConnection::Ptr conn = static_pointer_cast<DbConnection>(dtype->GetObject(idoName));
if (!conn) {
cr->SetOutput("IDO connection '" + idoName + "' does not exist.");
cr->SetState(ServiceUnknown);
checkable->ProcessCheckResult(cr);
return;
}
double qps = conn->GetQueryCount(60) / 60.0;
if (!conn->GetConnected()) {