From 995f757ab22f6c4bfbba4eb41d337a5314ef9086 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 22 Mar 2012 15:07:27 +0000 Subject: util.debug: Attempt to get debug.traceback() parameter handling correct (again) --- util/debug.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/debug.lua b/util/debug.lua index 2170a6d1..f70e20dd 100644 --- a/util/debug.lua +++ b/util/debug.lua @@ -95,7 +95,11 @@ function debug.traceback(thread, message, level) if level and type(message) ~= "string" then return nil, "invalid message"; elseif not level then - level = message or 2; + if type(message) == "number" then + level, message = message, nil; + else + level = 2; + end end message = message and (message.."\n") or ""; -- cgit v1.2.3