From: Gunnar Beutner Date: Tue, 2 Feb 2016 11:03:12 +0000 (+0100) Subject: Fix crash in IdoCheckTask::ScriptFunc X-Git-Tag: v2.5.0~562 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f234bdd3211c94f1c08e1a260aa43e5fdca54999;p=icinga2 Fix crash in IdoCheckTask::ScriptFunc refs #11014 --- diff --git a/lib/db_ido/idochecktask.cpp b/lib/db_ido/idochecktask.cpp index 92c82fcc9..a2cce8172 100644 --- a/lib/db_ido/idochecktask.cpp +++ b/lib/db_ido/idochecktask.cpp @@ -92,6 +92,13 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult DbConnection::Ptr conn = static_pointer_cast(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()) {