# HG changeset patch # User Matthew Wild # Date 1321742430 0 # Node ID 70b5e533325dbc3c7df84e819625b5c7b8c61846 # Parent 33c149394dcb76f474b17a51d54189aa51acef43 util.debug: Fix potential traceback diff -r 33c149394dcb -r 70b5e533325d util/debug.lua --- a/util/debug.lua Sat Nov 19 21:12:23 2011 +0500 +++ b/util/debug.lua Sat Nov 19 22:40:30 2011 +0000 @@ -20,10 +20,12 @@ 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