diff --git a/AtlasLootClassic/Addons/Favourites.lua b/AtlasLootClassic/Addons/Favourites.lua index 104a1e7a..37d79288 100644 --- a/AtlasLootClassic/Addons/Favourites.lua +++ b/AtlasLootClassic/Addons/Favourites.lua @@ -840,24 +840,29 @@ function Favourites:CountFavouritesByList(addonName, contentName, boss, dif, inc local items, tableType, diffData = ItemDB:GetItemTable(addonName, contentName, boss, dif) for l, listData in pairs(self.db.lists) do local listName = listData.__name - for i = 1, #items do - local item = items[i] - if type(item[2]) == "number" then - local itemID = item[2] - if listData[itemID] and (includeObsolete or not self:IsItemEquippedOrObsolete(itemID, l)) then - result[listName] = (result[listName] or 0) + 1 + + if type(items) == "table" then + for i = 1, #items do + local item = items[i] + if type(item[2]) == "number" then + local itemID = item[2] + if listData[itemID] and (includeObsolete or not self:IsItemEquippedOrObsolete(itemID, l)) then + result[listName] = (result[listName] or 0) + 1 + end end end end end for l, listData in pairs(self.globalDb.lists) do local listName = listData.__name - for i = 1, #items do - local item = items[i] - if type(item[2]) == "number" then - local itemID = item[2] - if listData[itemID] and (includeObsolete or not self:IsItemEquippedOrObsolete(itemID, l)) then - result[listName] = (result[listName] or 0) + 1 + if type(items) == "table" then + for i = 1, #items do + local item = items[i] + if type(item[2]) == "number" then + local itemID = item[2] + if listData[itemID] and (includeObsolete or not self:IsItemEquippedOrObsolete(itemID, l)) then + result[listName] = (result[listName] or 0) + 1 + end end end end diff --git a/AtlasLootClassic/ItemDB/ItemDB.lua b/AtlasLootClassic/ItemDB/ItemDB.lua index 15027234..3802c38e 100644 --- a/AtlasLootClassic/ItemDB/ItemDB.lua +++ b/AtlasLootClassic/ItemDB/ItemDB.lua @@ -243,7 +243,12 @@ end function ItemDB:GetItemTable(addonName, contentName, boss, dif) assert(addonName and ItemDB.Storage[addonName], addonName.." (addonName) not found!") assert(contentName and ItemDB.Storage[addonName][contentName], contentName.." (contentName) not found!") - assert(boss and ItemDB.Storage[addonName][contentName].items[boss], boss.." (boss) not found!") + -- assert(boss and ItemDB.Storage[addonName][contentName].items[boss], boss.." (boss) not found!") + + if boss == nil or ItemDB.Storage[addonName][contentName].items[boss] == nil then + return + end + local addonNameRETVALUE, addon if ItemDB.Storage[addonName][contentName].items[boss].link then return ItemDB:GetItemTable(ItemDB.Storage[addonName][contentName].items[boss].link[1], ItemDB.Storage[addonName][contentName].items[boss].link[2], ItemDB.Storage[addonName][contentName].items[boss].link[3], dif)