# HG changeset patch # User Matthew Wild # Date 1422627711 0 # Node ID 2b5ced5ca31f0e42c085d4cc5a108edebbaf057a # Parent 0ef7ca5276a15c47f2c5960993226dd3f8127b8e util.statistics: Return 0 as percentile if data out of range diff -r 0ef7ca5276a1 -r 2b5ced5ca31f util/statistics.lua --- a/util/statistics.lua Mon Jan 26 15:25:16 2015 +0100 +++ b/util/statistics.lua Fri Jan 30 14:21:51 2015 +0000 @@ -8,7 +8,7 @@ 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