valkyrnstudios / RankSentinel

MIT License
4 stars 3 forks source link

Fix attempt to call method 'SetPoint' (a nil value) on load #16

Closed SabreValkyrn closed 2 years ago

SabreValkyrn commented 2 years ago
Message: Interface\FrameXML\PlayerFrame.lua:330: attempt to call method 'SetPoint' (a nil value)
Time: Sat Dec 25 14:34:31 2021
Count: 1
Stack: Interface\FrameXML\PlayerFrame.lua:330: attempt to call method 'SetPoint' (a nil value)
[string "@Interface\FrameXML\PlayerFrame.lua"]:330: in function `PlayerFrame_ToPlayerArt'
[string "@Interface\FrameXML\PlayerFrame.lua"]:152: in function <Interface\FrameXML\PlayerFrame.lua:134>

Locals: self = PlayerFrame {
 0 = <userdata>
 statusCounter = 0
 portrait = PlayerPortrait {
 }
 manabar = PlayerFrameManaBar {
 }
 statusSign = -1
 unit = "player"
 inSequence = false
 state = "player"
 name = PlayerName {
 }
 feedbackText = PlayerHitIndicator {
 }
 isAnimatedOut = false
 menu = <function> defined @Interface\FrameXML\PlayerFrame.lua:47
 feedbackFontHeight = 30
 healthbar = PlayerFrameHealthBar {
 }
}
(temporary) = nil
(temporary) = "REDACT"
(temporary) = "CENTER"
(temporary) = 50
(temporary) = 19
(temporary) = "attempt to call method 'SetPoint' (a nil value)"
SabreValkyrn commented 2 years ago

Removing GUI related Ace options didn't change this behavior.

I locally removed AceComm lib and logic as well, still erroring.

SabreValkyrn commented 2 years ago

Somehow this was caused by PlayerGUID and PlayerName being global variables. https://github.com/valkyrnstudios/RankSentinel/commit/17d9c61c9e803b239adf73eadca40055fed419bb#diff-8e12ced70ffe478a33e70f3b9109b65d33e2835d1a9895cad7b99734411a36c7L6-L7

Moved to class variables and error went away. https://github.com/valkyrnstudios/RankSentinel/commit/17d9c61c9e803b239adf73eadca40055fed419bb#diff-8e12ced70ffe478a33e70f3b9109b65d33e2835d1a9895cad7b99734411a36c7R30-R31