From 8422230dae4e01daed5915c125b0c42a41b4243c Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 28 Aug 2014 16:55:53 -0400 Subject: [PATCH] luatz/timetable: Check argument to `new_from_timestamp` --- luatz/timetable.lua | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5