CustomVariables: do not count deleted vars

This commit is contained in:
Thomas Gelf 2016-02-25 19:40:06 +01:00
parent a3a17df437
commit 2bac3c682f

View File

@ -22,7 +22,14 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
public function count()
{
return count($this->vars);
$count = 0;
foreach ($this->vars as $var) {
if (! $var->hasBeenDeleted()) {
$count++;
}
}
return $count;
}
public function rewind()