From a511d85e2948300993256cebae9656c4cc60dcb2 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 3 Feb 2021 00:44:42 +0000 Subject: [PATCH] human_time: correctly handle non-number inputs --- worldeditadditions/utils/strings.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/worldeditadditions/utils/strings.lua b/worldeditadditions/utils/strings.lua index 2751f4c..1caad5a 100644 --- a/worldeditadditions/utils/strings.lua +++ b/worldeditadditions/utils/strings.lua @@ -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' },