From c4ef2a345ac43b1a290229a897df6ff8c7b12931 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 27 Sep 2023 15:57:04 +0200 Subject: [PATCH] check for null --- last_stats.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/last_stats.php b/last_stats.php index 677b816..26f3666 100644 --- a/last_stats.php +++ b/last_stats.php @@ -38,7 +38,7 @@ error_reporting(E_ALL); "; foreach ($players_matches as $player_data) { - if (isset($player_data['updated'])) { + if (!isset($player_data['playername']) || is_null($player_data['playername'])) { continue; // Skip this iteration and move to the next } $player_name = $player_data['playername']; @@ -48,8 +48,6 @@ error_reporting(E_ALL); $matches = $player_data['matches']; $KD_H = ($player_data['KD_H'] == "Infinity") ? "∞" : number_format($player_data['KD_H'], 2, ',', ''); $KD_ALL = ($player_data['KD_ALL'] == "Infinity") ? "∞" : number_format($player_data['KD_ALL'], 2, ',', ''); - echo $KD_H; - echo $KD_ALL; echo " $player_name