From a545362ba5ff895e37153f07fcaf18dc6a923233 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 25 Oct 2013 14:48:36 +0200 Subject: [PATCH] [FIX] getUserShareDifficulty must return 0 on NULL --- public/include/classes/statistics.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index 7a259d28..38f5360a 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -398,7 +398,7 @@ class Statistics { if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data; $stmt = $this->mysqli->prepare(" SELECT - AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) AS avgsharediff, + IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff, COUNT(s.id) AS total FROM " . $this->share->getTableName() . " AS s JOIN " . $this->user->getTableName() . " AS a ON a.username = SUBSTRING_INDEX( s.username, '.', 1 )