WeakAuras

WeakAuras

206M Downloads

Error in Custom Variables FRAME_UPDATE variable breaks WA Options

nullKomplex opened this issue ยท 0 comments

commented

Describe the bug

An error in a Custom Variable that uses events and such causes the WA Options to break. Clicking Okay does not close the window, text doesn't update, and upon a reload you can no longer edit that aura.

Initially when I discovered this bug it broke other auras as well, and upon reloading it was no longer possible to open WA Options but it seems I did not replicate that behavior.

Do you have an error log of what happened?
Upon reloading and opening WA Options:

1074x [string "--[==[ Error in 'Unknown' ]==] return funct..."]:8: attempt to index field 'pandTable' (a nil value)
[string "--[==[ Error in 'Unknown' ]==] return function() return 
{
    currentPandemic = {
        display = "Pandemic at current CP",
        type = "bool",
        test = function(state, needle)
            local exp = state.expirationTime
            local pand = state.pandTable[state.CPc]
            if(exp and pand) then
                local ret = pand >= (exp - GetTime()) 
                return needle == 1 == ret
            end
        end,
        events = { "FRAME_UPDATE" }
    },
}
 end"]:8: in function `?'
[string "--[==[ Error in 'New':'condition checks' ]==] local newActiveConditions = {};
local propertyChanges = {};
local nextTime;
return function(region, hideRegion)
  local id = region.id
  local cloneId = region.cloneId or ''
  local activatedConditions = WeakAuras.GetActiveConditions(id, cloneId)
  wipe(newActiveConditions)
  local recheckTime;
  local now = GetTime();
 if (not hideRegion) then
    state = region.states
    if (state and WeakAuras.customConditionTestFunctions[791](state[1], 1, nil)) then
      newActiveConditions[1] = true;
    end

  end
  if (recheckTime) then
    WeakAuras.scheduleConditionCheck(recheckTime, id, cloneId);
  end
  wipe(propertyChanges)
  if (activatedConditions[1] and not newActiveConditions[1]) then
    propertyChanges['sub.1.text_visible'] = true
  end

  if (newActiveConditions[1]) then
    if (not activatedConditions[1]) then
      propertyChanges['sub.1.text_visible'] = false
    else
      if(propertyChanges['sub.1.text_visible'] ~= nil) then
        propertyChanges['sub.1.text_visible'] = false
      end
    end
  end

  activatedConditions[1] = newActiveConditions[1]
  if(propertyChanges['sub.1.text_visible'] ~= nil) then
    region.subRegions[1]:SetVisible(propertyChanges['sub.1.text_visible'])
  end
end
"]:13: in function `?'
[string "@WeakAuras\WeakAuras-@[email protected]"]:5912: in function <WeakAuras\WeakAuras.lua:5877>
[string "@WeakAuras\WeakAuras-@[email protected]"]:5994: in function `UpdatedTriggerState'
[string "@WeakAuras\WeakAuras-@[email protected]"]:5760: in function `UpdateFakeStatesFor'
[string "@WeakAuras\WeakAuras-@[email protected]"]:5730: in function `FakeStatesFor'
[string "@WeakAuras\WeakAuras-@[email protected]"]:4379: in function <WeakAuras\WeakAuras.lua:4267>
[string "@WeakAuras\WeakAuras-@[email protected]"]:4394: in function `Add'
[string "@WeakAurasOptions\OptionsFrames\TextEditor.lua"]:435: in function `Close'
[string "@WeakAurasOptions\OptionsFrames\TextEditor.lua"]:156: in function <WeakAurasOptions\OptionsFrames\TextEditor.lua:156>

Locals:
state = <table> {
 triggernum = 1
 progressType = "timed"
 changed = true
 expirationTime = 309903.680000
 show = true
 autoHide = false
 id = "New"
 trigger = <table> {
 }
 duration = 7
}
needle = 1
exp = 309903.680000
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'pandTable' (a nil value)"

To Reproduce

  1. Import aura below
  2. Observe errors (attempt to edit any code blocks, etc)
  3. Reload
  4. Attempt to edit aura again

Screenshots

Did you try having WeakAuras as the only enabled addon and everything else (especially something like ElvUI) disabled?
Tested with only the 5 official WA addons enabled.

Which version of WeakAuras are you using?

fa0a9d3

Are you on World of Warcraft Classic or Retail?

  • Classic
  • Retail

Additional Info

https://wago.io/1VaTWhr-E