monitoring/detail: Don't fail if a macro does not exist on the host or service

This commit is contained in:
Eric Lippmann 2015-09-04 18:10:28 +02:00
parent f73e6d9225
commit c9c5762320
1 changed files with 2 additions and 2 deletions

View File

@ -55,10 +55,10 @@ class Macro
*/ */
public static function resolveMacro($macro, $object) 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]}; return $object->{self::$icingaMacros[$macro]};
} }
if (array_key_exists($macro, $object->customvars)) { if (isset($object->customvars[$macro])) {
return $object->customvars[$macro]; return $object->customvars[$macro];
} }