From: daurnimator Date: Thu, 28 Aug 2014 20:55:53 +0000 (-0400) Subject: luatz/timetable: Check argument to `new_from_timestamp` X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/8422230dae4e01daed5915c125b0c42a41b4243c?ds=inline luatz/timetable: Check argument to `new_from_timestamp` --- diff --git a/luatz/timetable.lua b/luatz/timetable.lua index 10af170..f096372 100644 --- a/luatz/timetable.lua +++ b/luatz/timetable.lua @@ -193,6 +193,9 @@ function timetable_methods:clone ( ) end local function new_from_timestamp ( ts ) + if type ( ts ) ~= "number" then + error ( "bad argument #1 to 'new_from_timestamp' (number expected, got " .. type ( ts ) .. ")" , 2 ) + end return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts ) end