human_time: correctly handle non-number inputs

This commit is contained in:
Starbeamrainbowlabs 2021-02-03 00:44:42 +00:00
parent 39a7168ac8
commit a511d85e29
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 1 additions and 0 deletions

View File

@ -247,6 +247,7 @@ end
-- @param ms float The number of milliseconds to convert.
-- @return string A human-readable string representing the input ms.
function worldeditadditions.human_time(ms)
if type(ms) ~= "number" then return "unknown" end
local tokens = {
{ 31536000 * 1000, 'year' },
{ 2592000 * 1000, 'month' },