From 6a160a3afe7325a0684bbac919b00785be40754f Mon Sep 17 00:00:00 2001 From: rxi Date: Mon, 28 Apr 2014 12:52:29 +0100 Subject: [PATCH] Fixed iscallable() to handle the lack of metatable properly --- lume.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lume.lua b/lume.lua index 9a179f4..51834ba 100644 --- a/lume.lua +++ b/lume.lua @@ -30,7 +30,9 @@ local absindex = function(len, i) end local iscallable = function(x) - return type(x) == "function" or getmetatable(x).__call ~= nil + if type(x) == "function" then return true end + local mt = getmetatable(x) + return mt and mt.__call ~= nil end