From c9c57623201e1c971b5d626b75a7f1eeb84c64f3 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 4 Sep 2015 18:10:28 +0200 Subject: [PATCH] monitoring/detail: Don't fail if a macro does not exist on the host or service --- modules/monitoring/library/Monitoring/Object/Macro.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Object/Macro.php b/modules/monitoring/library/Monitoring/Object/Macro.php index 4a9045b58..0a6f3a8c0 100644 --- a/modules/monitoring/library/Monitoring/Object/Macro.php +++ b/modules/monitoring/library/Monitoring/Object/Macro.php @@ -55,10 +55,10 @@ class Macro */ public static function resolveMacro($macro, $object) { - if (array_key_exists($macro, self::$icingaMacros) && $object->{self::$icingaMacros[$macro]} !== false) { + if (isset(self::$icingaMacros[$macro]) && isset($object->{self::$icingaMacros[$macro]})) { return $object->{self::$icingaMacros[$macro]}; } - if (array_key_exists($macro, $object->customvars)) { + if (isset($object->customvars[$macro])) { return $object->customvars[$macro]; }