From 753d9420c3f10b4ef3f6dd5d6202380e19dec90a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 24 Jul 2015 10:58:02 +0200 Subject: [PATCH] IcingaConfig: throw exception when missing --- library/Director/IcingaConfig/IcingaConfig.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 4971597f..efa94863 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -227,6 +227,11 @@ class IcingaConfig array('checksum', 'last_activity_checksum') )->where('checksum = ?', $this->dbBin($checksum)); $result = $this->db->fetchRow($query); + + if (empty($result)) { + throw new Exception(sprintf('Got no config for %s', Util::binary2hex($checksum))); + } + $this->checksum = $result->checksum; $this->lastActivityChecksum = $result->last_activity_checksum;