From d4d7b9bcb98e7e635ae5f95a91654b9622df6ebd Mon Sep 17 00:00:00 2001 From: kilick <2651115+kilick@users.noreply.github.com> Date: Tue, 26 May 2026 15:05:52 -0700 Subject: [PATCH] Wipe* helpers: skip non-table inputs instead of erroring ClearAllData and DeleteGuild iterate registered modules and pass moduleDB.Characters / .Guilds to WipeCharacterTable / WipeGuildTable. For some modules these references resolve to a function (via the DataStore method metatable), which then crashes pairs() with 'bad argument #1 to pairs (table expected, got function)'. Use a type check instead of a truthiness check so non-table inputs are silently skipped, matching the original intent for missing keys. Fixes Altoholic_Retail#33. --- DataStore/DataStore.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataStore/DataStore.lua b/DataStore/DataStore.lua index ced59db..2b6b190 100644 --- a/DataStore/DataStore.lua +++ b/DataStore/DataStore.lua @@ -396,7 +396,7 @@ function addon:DeleteRealm(realm, account) end local function WipeCharacterTable(t) - if not t then return end + if type(t) ~= "table" then return end for key, v in pairs(t) do -- key is the character key if key ~= addon.ThisCharKey then -- only delete an entry if it is not the current character @@ -406,7 +406,7 @@ local function WipeCharacterTable(t) end local function WipeGuildTable(t) - if not t then return end + if type(t) ~= "table" then return end for key, v in pairs(t) do -- key is the guild key t[key] = nil