NeatPlates

NeatPlates

7M Downloads

New bug since release v422 (occured just after updating it), playing warrior

sthdevilish opened this issue ยท 4 comments

commented

27x ...nterface/AddOns/NeatPlatesWidgets/ResourceWidget.lua:310: attempt to index local 'data' (a nil value)
[string "@Interface/AddOns/NeatPlatesWidgets/ResourceWidget.lua"]:310: in function <...nterface/AddOns/NeatPlatesWidgets/ResourceWidget.lua:306>
[string "@Interface/AddOns/NeatPlatesWidgets/ResourceWidget.lua"]:412: in function UpdatePoints' [string "@Interface/AddOns/NeatPlatesWidgets/ResourceWidget.lua"]:557: in function createFunction'
[string "@Interface/AddOns/NeatPlatesHub/functions/Widgets.lua"]:626: in function <Interface/AddOns/NeatPlatesHub/functions/Widgets.lua:613>
[string "@Interface/AddOns/NeatPlatesHub/functions/Widgets.lua"]:664: in function OnInitializeWidgets' [string "@Interface/AddOns/NeatPlatesHub/functions/Core.lua"]:531: in function OnInitialize'
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:762: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:718>
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:1623: in function `?'
[string "@Interface/AddOns/NeatPlates/NeatPlatesCore.lua"]:1578: in function <Interface/AddOns/NeatPlates/NeatPlatesCore.lua:1576>

Locals:
data = nil
(*temporary) = "WARRIOR"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'data' (a nil value)"
PlayerClass = "WARRIOR"
PlayerSpec = 72
t =

{
DEATHKNIGHT =
{
}
PALADIN =
{
}
WARLOCK =
{
}
ROGUE =
{
}
MAGE =
{
}
DRUID =
{
}
RESOURCE_PATH = "Addons\NeatPlatesWidgets\ResourceWidget"
MONK =
{
}
}

commented

Came here to report same error.

I made the error go away by changing this function as follows.

local function GetPlayerPower()
    -- TODO: Do checks for if the power should be displayed etc here.
    if PlayerClass and PlayerSpec then
        local data = t[PlayerClass]
        if data then
            local showForSpec = not data["SPEC"] or NeatPlatesUtility.contains(data["SPEC"], PlayerSpec)
            if showForSpec then
                return data["GetPower"](data)
            end
        end
    end
    return nil, nil
end
commented

Well that's a silly mistake to make...

Real sorry about that, I've released a new update that fixes this.

commented

No worries, thank you. Happy to help.

commented

This issue is stale because it has been open for 90 days with no activity. If you feel the issue is still relevant, please leave a comment to prevent the issue from being closed in 30 days