aboutsummaryrefslogtreecommitdiffstats
path: root/util/debug.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/debug.lua')
-rw-r--r--util/debug.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/util/debug.lua b/util/debug.lua
index 0f0e24c0..22d02bf2 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -20,10 +20,12 @@ end
local function get_upvalues_table(func)
local upvalues = {};
- for upvalue_num = 1, math.huge do
- local name, value = debug.getupvalue(func, upvalue_num);
- if not name then break; end
- table.insert(upvalues, { name = name, value = value });
+ if func then
+ for upvalue_num = 1, math.huge do
+ local name, value = debug.getupvalue(func, upvalue_num);
+ if not name then break; end
+ table.insert(upvalues, { name = name, value = value });
+ end
end
return upvalues;
end