diff --git a/app/Filament/Widgets/StatsMedianAverage.php b/app/Filament/Widgets/StatsMedianAverage.php index bc7f139f..a99a38a3 100644 --- a/app/Filament/Widgets/StatsMedianAverage.php +++ b/app/Filament/Widgets/StatsMedianAverage.php @@ -77,19 +77,22 @@ class StatsMedianAverage extends StatsOverviewWidget // $median_away = 0; // } - if (isset($data['results'])) { + if (isset($data['results']) && $team_id) { // Log::debug($data['results']); $win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0; $draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0; $lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0; } else { - return []; + $win = 0; + $draw = 0; + $lost = 0; } if ($total_home && $team_id) { $value_home = number_format($summe_home / $total_home, 1); } else { $value_home = 0; + $total_home = 0; } if ($total_away && $team_id) { $value_away = number_format($summe_away / $total_away, 1);