Skip to content

Conversation

Copy link

Copilot AI commented Sep 24, 2025

This PR fixes the error attempt to call method 'SetupWagoData' (a nil value) that was preventing users from opening the Wago UI in-game.

Root Cause

The error occurred because the wagoData.lua module was failing to load when LibStub:GetLibrary("LibAddonProfiles") was called without proper error handling. If the LibAddonProfiles library wasn't available at load time, the entire module would fail to load, making the SetupWagoData function unavailable when called during initialization.

The error stack trace showed:

Interface/AddOns/WagoUI/main.lua:67: attempt to call method 'SetupWagoData' (a nil value)

Solution

Implemented a comprehensive approach to handle LibAddonProfiles dependency issues:

  1. Safe Library Loading: Changed critical library imports from:

    local LAP = LibStub:GetLibrary("LibAddonProfiles")

    to:

    local LAP = LibStub and LibStub:GetLibrary("LibAddonProfiles", true)
  2. Protected Method Calls: Added null checks before using LibAddonProfiles methods:

    local lap = LAP and LAP:GetModule(moduleName)
  3. Function Existence Checks: Added guards before calling SetupWagoData:

    if addon.SetupWagoData then
      addon:SetupWagoData()
    end

Files Changed

  • WagoUI/main.lua: Protected SetupWagoData call in init()
  • WagoUI/modules/wagoData.lua: Safe library loading and method call protection
  • WagoUI/wagoFrames/introFrame/directProfilesPage.lua: Protected SetupWagoData call
  • WagoUI/wagoFrames/components/profileList.lua: Safe library loading
  • WagoUI/wagoFrames/altFrame/altFrame.lua: Safe library loading with method protection

The fix ensures the addon gracefully handles scenarios where LibAddonProfiles is unavailable while maintaining full functionality when it is present.

Fixes #25.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Author

Copilot AI commented Sep 24, 2025

@Stanzilla 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits September 24, 2025 10:50
…hecks

Co-authored-by: Stanzilla <75278+Stanzilla@users.noreply.github.com>
Co-authored-by: Stanzilla <75278+Stanzilla@users.noreply.github.com>
Copilot AI changed the title [WIP] Erroes encounted, unable to open wago in game Fix SetupWagoData nil value error by adding LibAddonProfiles safety checks Sep 24, 2025
Copilot AI requested a review from Stanzilla September 24, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Erroes encounted, unable to open wago in game

2 participants