seblindfors / ConsolePort

ConsolePort - Game Controller Addon for World of Warcraft
Artistic License 2.0
182 stars 39 forks source link

Fix stacksplit nil check order #35

Closed waldnercharles closed 5 years ago

waldnercharles commented 5 years ago

Changed the order of the checks so that you check if Left or Right is null prior to calling a method on them.

This fixes a LUA error when first opening the stacksplit frame. (When the left arrow is greyed out and nil)

seblindfors commented 5 years ago

The purpose of that line is not a nil check, so your pull request does not fix the problem.

waldnercharles commented 5 years ago

The purpose of that line is to determine if either the left arrow or right arrow is pressed.

But, it needs to check if the left arrow exists BEFORE it can call a method on it. Same for the right arrow.

I've tested in game, and it does seem to fix the Lua error from showing up. It was especially troublesome because it would generate the errors in a loop.

seblindfors commented 5 years ago

No, the purpose of the line is to upvalue the button that the script is supposed to press repeatedly. Your pull request is unfortunately not a solution for this. Check the updated master for what the solution is. Having that said, I do appreciate your effort.