From 6dd22208c9f920066ba99e27bf9f61d1a8d44d7e Mon Sep 17 00:00:00 2001 From: beu Date: Sun, 25 Jan 2026 10:27:37 +0100 Subject: [PATCH] fix stats crash --- core/Statistics/StatisticManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Statistics/StatisticManager.php b/core/Statistics/StatisticManager.php index 5324e387..c88de757 100644 --- a/core/Statistics/StatisticManager.php +++ b/core/Statistics/StatisticManager.php @@ -211,6 +211,10 @@ class StatisticManager implements UsageInformationAble { $mysqli = $this->maniaControl->getDatabase()->getMysqli(); $statId = $this->getStatId($statName); + if ($statId === null) { + return array(); + } + $query = "SELECT `playerId`, `serverIndex`, `value` FROM `" . self::TABLE_STATISTICS . "` WHERE `statId` = {$statId} "; if ($minValue >= 0) { @@ -227,7 +231,7 @@ class StatisticManager implements UsageInformationAble { $result = $mysqli->query($query); if (!$result) { trigger_error($mysqli->error); - return null; + return array(); } $stats = array();