aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-02-09 00:48:08 +0100
committerKim Alvefur <zash@zash.se>2015-02-09 00:48:08 +0100
commit8dda0484865684469a2708ded7c1c1ab9542d766 (patch)
tree49e5401cc7a67229f027c050c934149317ef2146 /util
parenta5b88cba341e0f99461b12d6dd42f54352c4b76a (diff)
parentb7a38c8c93f8e6bee2579de6b9468fbb68c14589 (diff)
downloadprosody-8dda0484865684469a2708ded7c1c1ab9542d766.tar.gz
prosody-8dda0484865684469a2708ded7c1c1ab9542d766.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/statistics.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/statistics.lua b/util/statistics.lua
index 08c765ae..a05a1f91 100644
--- a/util/statistics.lua
+++ b/util/statistics.lua
@@ -8,7 +8,7 @@ local function percentile(arr, length, pc)
local n = pc/100 * (length + 1);
local k, d = m_floor(n), n%1;
if k == 0 then
- return arr[1];
+ return arr[1] or 0;
elseif k >= length then
return arr[length];
end