ProcessProblemsBadge: Fix variable $count is probably undefined

This commit is contained in:
Sukhwinder Dhillon 2023-08-14 12:44:27 +02:00
parent 52732dc3c7
commit 74c3440ef9

View file

@ -19,12 +19,10 @@ class ProcessProblemsBadge extends BadgeNavigationItemRenderer
public function getCount()
{
$count = 0;
if ($this->count === null) {
$storage = LegacyStorage::getInstance();
$count = 0;
$bp = $storage->loadProcess($this->getBpConfigName());
foreach ($bp->getRootNodes() as $rootNode) {
if (! $rootNode->isEmpty() &&
$rootNode->getState() !== $rootNode::ICINGA_PENDING