fix stats crash

This commit is contained in:
Beu
2026-01-25 10:27:37 +01:00
parent 928c72c501
commit 6dd22208c9

View File

@@ -211,6 +211,10 @@ class StatisticManager implements UsageInformationAble {
$mysqli = $this->maniaControl->getDatabase()->getMysqli(); $mysqli = $this->maniaControl->getDatabase()->getMysqli();
$statId = $this->getStatId($statName); $statId = $this->getStatId($statName);
if ($statId === null) {
return array();
}
$query = "SELECT `playerId`, `serverIndex`, `value` FROM `" . self::TABLE_STATISTICS . "` $query = "SELECT `playerId`, `serverIndex`, `value` FROM `" . self::TABLE_STATISTICS . "`
WHERE `statId` = {$statId} "; WHERE `statId` = {$statId} ";
if ($minValue >= 0) { if ($minValue >= 0) {
@@ -227,7 +231,7 @@ class StatisticManager implements UsageInformationAble {
$result = $mysqli->query($query); $result = $mysqli->query($query);
if (!$result) { if (!$result) {
trigger_error($mysqli->error); trigger_error($mysqli->error);
return null; return array();
} }
$stats = array(); $stats = array();