From 219e74904691f276a488e7b37fda6b2ffc630627 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Fri, 29 May 2026 20:05:03 +0200 Subject: [PATCH] coa.18: guard DataStore_Achievements nil criteria quantity GetAchievementCriteriaInfo returns nil reqQuantity/quantity for some CoA achievements; 'reqQuantity > 1' crashed. Guarded both. --- Altoholic/Altoholic.toc | 2 +- DataStore_Achievements/DataStore_Achievements.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Altoholic/Altoholic.toc b/Altoholic/Altoholic.toc index a225962..e9bfd29 100644 --- a/Altoholic/Altoholic.toc +++ b/Altoholic/Altoholic.toc @@ -13,7 +13,7 @@ ## Author: Thaoky, Telkar-RG ## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at -## Version: 3.3.002b-coa.17 +## Version: 3.3.002b-coa.18 ## X-Category: Inventory, Tradeskill, Mail ## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU ## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx diff --git a/DataStore_Achievements/DataStore_Achievements.lua b/DataStore_Achievements/DataStore_Achievements.lua index e8525f2..9ab3ece 100644 --- a/DataStore_Achievements/DataStore_Achievements.lua +++ b/DataStore_Achievements/DataStore_Achievements.lua @@ -55,8 +55,8 @@ local function ScanSingleAchievement(id, isCompleted, month, day, year) if critCompleted then table.insert(CriteriaCache, tostring(j)) else - if reqQuantity > 1 then - table.insert(CriteriaCache, j .. ":" .. quantity) + if (reqQuantity or 0) > 1 then -- CoA: GetAchievementCriteriaInfo can return nil quantities for custom/partial achievements + table.insert(CriteriaCache, j .. ":" .. (quantity or 0)) end end end