From 694524a8556e0d31899880c8c26d195bc06c1eb8 Mon Sep 17 00:00:00 2001 From: urnati Date: Sat, 22 Sep 2018 03:18:20 -0400 Subject: [PATCH] - TitanMovable : Fix minor bug; Remove debug statement --- Titan/LDBToTitan.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Titan/LDBToTitan.lua b/Titan/LDBToTitan.lua index df834fc..10b8e83 100644 --- a/Titan/LDBToTitan.lua +++ b/Titan/LDBToTitan.lua @@ -663,7 +663,8 @@ local function CreateObject(self, _, name, obj) -- These checks are messy but leave notes for the developer tempname = nil if obj.tocname then - if pcall(function() IsAddOnLoaded(obj.tocname) end) then + local ok, msg = pcall(function() return IsAddOnLoaded(obj.tocname) end) + if ok and msg then tempname = obj.tocname else notes = notes.."\n" @@ -671,13 +672,15 @@ local function CreateObject(self, _, name, obj) .." does NOT match the addon name per the LibDataBroker spec." end end - if tempname == nil and pcall(function() IsAddOnLoaded(name) end) then - tempname = name - else - tempname = nil - notes = notes.."\n" - .."The LDB name '"..name.."'" - .." does NOT match the addon name." + if tempname == nil then + local ok, msg = pcall(function() return IsAddOnLoaded(name) end) + if ok and msg then + tempname = name + else + notes = notes.."\n" + .."The LDB name '"..name.."'" + .." does NOT match the addon name." + end end -- check for category and version from the TOC file local cat, ver @@ -878,4 +881,3 @@ LDBToTitan:SetScript("OnEvent", function(self, event, ...) end end ) -TitanPrint("LDB to Titan") -- 1.7.9.5