aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-11-19 22:40:30 +0000
committerMatthew Wild <mwild1@gmail.com>2011-11-19 22:40:30 +0000
commitf64aa48b0f869bfd05272715264d41328bb8ae81 (patch)
treee127a4c05aace743955fa14e2bf98b4bd218c401 /util
parent54aa5182e966f6fdb11b47a2a13b006e9aff6dfd (diff)
downloadprosody-f64aa48b0f869bfd05272715264d41328bb8ae81.tar.gz
prosody-f64aa48b0f869bfd05272715264d41328bb8ae81.zip
util.debug: Fix potential traceback
Diffstat (limited to 'util')
-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