Auctionator

Auctionator

141M Downloads

Rapport Error Lua

sonikozerg opened this issue · 5 comments

commented

Here you can find the rapport : Interface\AddOns\Auctionator\zcUtils.lua:1067: bad argument 1 to 'pairs' (table expected, got nil)

VERS:3.2.4 MEM: 10518 KB DB:8510 SE:1 SL:9 FSCHUNK: DBVERS:4

REALMS: , Hyjal_Alliance (13207), Uldaman_Horde (0), Kirin Tor_Alliance (0), Sinstralis_Horde (7), Archimonde_Horde (8510), Khaz Modan_Alliance (0), Dalaran_Alliance (6577), Archimonde_Alliance (22), Sargeras_Horde (3), Ysondre_Horde (0), Eitrigg_Alliance (6), Eldre'Thalas_Alliance (87), Khaz Modan_Horde (94), Hyjal_Horde (31), Naxxramas_Alliance (0), Confrérie du Thorium_Alliance (0), Elune_Horde (0), Outland_Alliance (4), Suramar_Horde (0)

STACK: pairs > CopyDeep > Atr_OnBagUpdate > Atr_EventHandler

ADDONS: , _NPCScan, AckisRecipeList, AtlasLoot, Auctionator, AutoRepair, BagBrother, Bagnon, BigDebuffs, DugisGuideViewerZ, ExtraCD, MasterPlanA, MikScrollingBattleText, MogIt, NugComboBar, Postal, Scrap, Skada, Storyline, Titan, WeakAuras, TradeSkillMaster, ElvUI, DBM

commented

Sry for late reply. Yes there are a way to not check for table twice. Thow you need to check it twice for the first time, as you do not know if you have passed the table in the function. the way you do that is that you make a local function inside the main function. So in the main function, you check for table, and then call the table copy function. Then for the next table, you just call the local function inside the function

commented

Possbile sulution: Old code

function zc.CopyDeep (dest, src)

    for n, v in pairs (src) do
        if (type(v) == "table") then
            dest[n] = {};
            zc.CopyDeep(dest[n], v);
        else
            dest[n] = v;
        end
    end

end

new code:

function zc.CopyDeep (dest, src)
    if type(src)~="table" then
        --[[
        Here you might want to set dest = src, 
        thow this is dangerus if you need CopyDeep
        to be a table
        ]]
        return
    end

    for n, v in pairs (src) do
        if (type(v) == "table") then
            dest[n] = {};
            zc.CopyDeep(dest[n], v);
        else
            dest[n] = v;
        end
    end
end
commented

@Meltinnglava Out of curiosity, why not just:

if not src then 
  return
end

The error seems to be saying that the source table is nil, which makes me think we should just skip the copy (though I suspect this indicates there's something awry in Atr_OnBagUpdate)... I need to update the error handling logic to provide stack trace line numbers. 😦

commented

Ah, to preserve the entry in the table, I think I answered my own question. 😄

I'm gonna try:

  if type(src) == 'table' then

    for n, v in pairs (src) do
      if (type(v) == "table") then
        dest[n] = {};
        zc.CopyDeep(dest[n], v);
      else
        dest[n] = v;
      end
    end

  else
    dest = src
  end

Although I feel like there's a way to prevent checking for table twice...

commented

Fix in 3.2.5 release (thanks @Meltinnglava )