diff --git a/src/Controller/BadgeController.php b/src/Controller/BadgeController.php index 27cf753..4fa83fc 100644 --- a/src/Controller/BadgeController.php +++ b/src/Controller/BadgeController.php @@ -23,7 +23,7 @@ class BadgeController extends AbstractController } $stats = $taskLifecycleManager->getProjectStats($project); - if (!isset($stats[$status])) { + if (empty($stats) || !isset($stats[$status])) { throw new NotFoundHttpException('Status not found'); } diff --git a/src/Service/TaskLifecycleManager.php b/src/Service/TaskLifecycleManager.php index 1e40f68..0c9a663 100644 --- a/src/Service/TaskLifecycleManager.php +++ b/src/Service/TaskLifecycleManager.php @@ -36,6 +36,7 @@ class TaskLifecycleManager foreach ($places as $place => $id) { $stats[$place] = array_merge($metas->getPlaceMetadata($place), [ 'value' => 0, + 'percentage' => 0, ]); }