IcingaObjectGroups: Fix empty groups rendering

fixes #9432
This commit is contained in:
Alexander Fuhr 2015-06-17 12:30:59 +02:00
parent 6fcb16ced8
commit ef537160f7
1 changed files with 7 additions and 1 deletions

View File

@ -245,7 +245,13 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
public function toConfigString()
{
return c::renderKeyValue('groups', c::renderArray(array_keys($this->groups)));
$groups = array_keys($this->groups);
if (empty($groups)) {
return '';
}
return c::renderKeyValue('groups', c::renderArray($groups));
}
public function __toString()