From dcdb15286a76b025f4318ba780354f130f5cf8de Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 12 May 2017 21:34:41 +0200 Subject: [PATCH] small fix --- core/Statistics/StatisticCollector.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/Statistics/StatisticCollector.php b/core/Statistics/StatisticCollector.php index 7907ccdd..ec00f55a 100644 --- a/core/Statistics/StatisticCollector.php +++ b/core/Statistics/StatisticCollector.php @@ -304,7 +304,10 @@ class StatisticCollector implements CallbackListener { //TODO remove old callbac $durationTime = ($structure->getTime() - $this->startPlayLoopTime) / 1000; - $this->maniaControl->getStatisticManager()->insertStat(self::STAT_PLAYTIME, $structure->getPlayer(), $this->maniaControl->getServer()->index, $durationTime); + //TODO reverify why player can be 0 + if($structure->getPlayer()){ + $this->maniaControl->getStatisticManager()->insertStat(self::STAT_PLAYTIME, $structure->getPlayer(), $this->maniaControl->getServer()->index, $durationTime); + } }