From d2f5d3b452c88f59fee547bb07e87cbcb69d24c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:44:49 +0000 Subject: [PATCH 1/3] Initial plan From ad9254686747987cd80693deaccc4a1515bff3db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:50:36 +0000 Subject: [PATCH 2/3] Fix SetupWagoData nil value error by adding LibAddonProfiles safety checks Co-authored-by: Stanzilla <75278+Stanzilla@users.noreply.github.com> --- WagoUI/main.lua | 4 +++- WagoUI/modules/wagoData.lua | 14 +++++++++----- .../wagoFrames/introFrame/directProfilesPage.lua | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/WagoUI/main.lua b/WagoUI/main.lua index e8022fb..9555010 100644 --- a/WagoUI/main.lua +++ b/WagoUI/main.lua @@ -64,7 +64,9 @@ end function init() addon:RegisterErrorHandledFunctions() - addon:SetupWagoData() + if addon.SetupWagoData then + addon:SetupWagoData() + end addon:CreateCopyHelper() local mainFrame = addon:CreateMainFrame() addon:CreateIntroFrame(mainFrame) diff --git a/WagoUI/modules/wagoData.lua b/WagoUI/modules/wagoData.lua index fb524a9..971ea70 100644 --- a/WagoUI/modules/wagoData.lua +++ b/WagoUI/modules/wagoData.lua @@ -1,6 +1,6 @@ ---@class WagoUI local addon = select(2, ...) -local LAP = LibStub:GetLibrary("LibAddonProfiles") +local LAP = LibStub and LibStub:GetLibrary("LibAddonProfiles", true) local db --- We want to get the latest imported profile for a character and module. @@ -75,7 +75,7 @@ function addon:SetupWagoData() if type(moduleData) == "string" then newIntroImportState[resolution][moduleName] = {} local profileData = source.profiles[resolution][moduleName] - local lap = LAP:GetModule(moduleName) + local lap = LAP and LAP:GetModule(moduleName) if profileData and lap then if lap:needsInitialization() then lap:openConfig() @@ -119,7 +119,7 @@ function addon:SetupWagoData() elseif moduleName == "WeakAuras" or moduleName == "Echo Raid Tools" then for groupId in pairs(moduleData) do local profile = source.profiles[resolution][moduleName] and source.profiles[resolution][moduleName][groupId] - local lap = LAP:GetModule(moduleName) + local lap = LAP and LAP:GetModule(moduleName) if profile and lap then tinsert( addon.wagoData[resolution], @@ -165,7 +165,9 @@ function addon:SetActivePack(packId) db.selectedWagoData = packId addon:RefreshResolutionDropdown() addon:SetUIPackDropdownToPack(packId) - addon:SetupWagoData() + if addon.SetupWagoData then + addon:SetupWagoData() + end addon:UpdateRegisteredDataConsumers() end @@ -195,7 +197,9 @@ function addon:GetResolutionsForDropdown() label = addon:GetResolutionString(key, "displayNameShort"), onclick = function() db.selectedWagoDataResolution = key - addon:SetupWagoData() + if addon.SetupWagoData then + addon:SetupWagoData() + end addon:UpdateRegisteredDataConsumers() end } diff --git a/WagoUI/wagoFrames/introFrame/directProfilesPage.lua b/WagoUI/wagoFrames/introFrame/directProfilesPage.lua index 8d871bb..d078bf5 100644 --- a/WagoUI/wagoFrames/introFrame/directProfilesPage.lua +++ b/WagoUI/wagoFrames/introFrame/directProfilesPage.lua @@ -45,7 +45,9 @@ local function createPage() for _, data in pairs(addon.db.introImportState[res]) do data.checked = value end - addon:SetupWagoData() + if addon.SetupWagoData then + addon:SetupWagoData() + end addon:UpdateRegisteredDataConsumers() end, checkboxDefaultValue From 06f6d18fa2b4b918031a2270f3c82c2bfa4ee291 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:54:20 +0000 Subject: [PATCH 3/3] Add LibAddonProfiles safety checks to additional WagoUI files Co-authored-by: Stanzilla <75278+Stanzilla@users.noreply.github.com> --- WagoUI/wagoFrames/altFrame/altFrame.lua | 16 ++++++++++------ WagoUI/wagoFrames/components/profileList.lua | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/WagoUI/wagoFrames/altFrame/altFrame.lua b/WagoUI/wagoFrames/altFrame/altFrame.lua index 6d062ab..56c69bb 100644 --- a/WagoUI/wagoFrames/altFrame/altFrame.lua +++ b/WagoUI/wagoFrames/altFrame/altFrame.lua @@ -5,7 +5,7 @@ local addon = select(2, ...) local DF = _G["DetailsFramework"] local LWF = LibStub("LibWagoFramework") local L = addon.L -local LAP = LibStub:GetLibrary("LibAddonProfiles") +local LAP = LibStub and LibStub:GetLibrary("LibAddonProfiles", true) ---@type string | nil local currentSelectedCharacter = nil @@ -24,7 +24,8 @@ local function setAllProfilesAsync() -- Keys that need to be retrieved from WagoUI db need to also be stored in WagoUI db again -- This is needed when the user "chains" characters addon:GetImportedProfilesTarget() - for _, lapModule in pairs(LAP:GetAllModules()) do + if LAP then + for _, lapModule in pairs(LAP:GetAllModules()) do if lapModule:isLoaded() and lapModule:isUpdated() then local profileAssignments = lapModule.getProfileAssignments and lapModule:getProfileAssignments() if profileAssignments then @@ -44,7 +45,7 @@ local function setAllProfilesAsync() addon:StoreImportedProfileData(updatedAt, lapModule.moduleName, profileKey) end end - elseif LAP:CanEnableAnyAddOn(lapModule.addonNames) then + elseif LAP and LAP:CanEnableAnyAddOn(lapModule.addonNames) then -- check if we have imported via WagoUI on that character and the module is not loaded -- we need to load the addon, reload UI and continue setting the profile local profileKey, updatedAt = addon:GetLatestImportedProfile(currentSelectedCharacter, lapModule.moduleName) @@ -55,6 +56,7 @@ local function setAllProfilesAsync() end coroutine.yield() end + end end function addon:ContinueSetAllProfiles() @@ -69,7 +71,7 @@ function addon:ContinueSetAllProfiles() function() for _, data in ipairs(addon.dbC.needLoad) do ---@type LibAddonProfilesModule - local lap = LAP:GetModule(data.moduleName) + local lap = LAP and LAP:GetModule(data.moduleName) local profileKeys = lap.getProfileKeys and lap:getProfileKeys() if profileKeys and data.profileKey and profileKeys[data.profileKey] then lap:setProfile(data.profileKey) @@ -179,8 +181,10 @@ function addon:CreateAltFrame(f) if #needLoad > 0 then addon.dbC.needLoad = needLoad for _, data in ipairs(needLoad) do - local lap = LAP:GetModule(data.moduleName) - LAP:EnableAddOns(lap.addonNames) + local lap = LAP and LAP:GetModule(data.moduleName) + if lap and LAP then + LAP:EnableAddOns(lap.addonNames) + end end header:SetText(L["altFrameHeader4"]) else diff --git a/WagoUI/wagoFrames/components/profileList.lua b/WagoUI/wagoFrames/components/profileList.lua index 2576bd6..ecbbe2a 100644 --- a/WagoUI/wagoFrames/components/profileList.lua +++ b/WagoUI/wagoFrames/components/profileList.lua @@ -4,7 +4,7 @@ local DF = _G["DetailsFramework"] local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") local db local L = addon.L -local LAP = LibStub:GetLibrary("LibAddonProfiles") +local LAP = LibStub and LibStub:GetLibrary("LibAddonProfiles", true) local widths = { options = 60,