From: Tobias Ulmer Date: Fri, 13 Jul 2012 12:06:28 +0000 (+0200) Subject: Don't crash if module is nil X-Git-Tag: e2factory-2.3.12rc1~3 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=9e2fd3799de275b3f5ff6d9b33875bf530a91ce6;p=e2factory.git Don't crash if module is nil Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 18cd19c..5d17eed 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -318,14 +318,12 @@ function tracer(event, line) -- approximate module name, not always accurate but good enough local module if ftbl.source == nil or ftbl.source == "=[C]" then - module = "" + module = "C." else - module = string.match(ftbl.source, "(%w+)%.lua$") - module = module .. "." - end - - if module == nil then - module "." + module = string.match(ftbl.source, "(%w+%.)lua$") + if module == nil then + module = "." + end end if event == "call" then