mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-22 19:45:02 +00:00
human_time: correctly handle non-number inputs
This commit is contained in:
parent
39a7168ac8
commit
a511d85e29
1 changed files with 1 additions and 0 deletions
|
@ -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' },
|
||||
|
|
Loading…
Reference in a new issue