From ac640fd113ca91fc0ac70979dbdc6bb70fc8c709 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 13 May 2016 14:20:31 +0200 Subject: [PATCH] IcingaConfig: do not benchmark no objects of type --- library/Director/IcingaConfig/IcingaConfig.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 04957d1a..58a40d93 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -420,6 +420,10 @@ class IcingaConfig protected function createFileForObjects($type, $objects) { + if (empty($objects)) { + return $this; + } + Benchmark::measure(sprintf('Generating %ss: %s', $type, count($objects))); foreach ($objects as $object) { if ($object->isExternal()) {