Skip to content

Error in OldSpellButton_UpdateButton: Attempt to index field 'bar' (nil value) #1

Description

@Loadren

Error in OldSpellButton_UpdateButton: Attempt to index field 'bar' (nil value)

Description:

When using the following code inside the OldSpellButton_UpdateButton function:

self:SetAttribute("type", "flyout")
self:SetAttribute("spell", spellID)

I encountered the following error:

11x ...eBlizzard_ActionBar/Mainline/SpellFlyout.lua:241: attempt to index field 'bar' (a nil value)
[string "@Blizzard_ActionBar/Mainline/SpellFlyout.lua"]:241: in function `Toggle'
[string "@OldSpellBook/OldSpellBookFrame.lua"]:513: in function <OldSpellBook/OldSpellBookFrame.lua:508>

Locals:
self = SpellFlyout {
 isActionBar = true
 eventsRegistered = false
 Background = Frame {
 }
}
flyoutID = 224
parent = OldSpellButton10 {
}
direction = "RIGHT"
distance = 0
isActionBar = true
specID = nil
...
(*temporary) = "attempt to index field 'bar' (a nil value)"

Steps to reproduce:

  1. Use OldSpellButton_UpdateButton to update a flyout spell button.
  2. Set the following attributes:
    self:SetAttribute("type", "flyout")
    self:SetAttribute("spell", spellID)
  3. The error appears when attempting to toggle the flyout in the spellbook.

Expected behavior:

Clicking the button should open the flyout without errors.

Actual behavior:

The error occurs when the function attempts to toggle the flyout, specifically due to an attempt to index a nil bar field in SpellFlyout.lua.

Possible fix:

From my understanding, the issue might be that the isActionBar flag is being incorrectly set to true. The Spellbook isn't an ActionBar.

WoW and AddOn Version:

WoW Version: 11.0.2
Addon Version: 0.5.1beta

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions