FishMaster

FishMaster

8k Downloads

[BUG] Double Right Click to Cast causes errors

Starlynk1 opened this issue ยท 2 comments

commented

I have Easy Cast enabled and when I double right click to cast, I am getting the following bugsack

949x Interface\AddOns\FishMaster\scripts/methods.lua:463: attempt to index global 'button' (a nil value)
[string "@Interface\AddOns\FishMaster\scripts/methods.lua"]:463: in function `ResetOverride'
[string "*:OnUpdate"]:1: in function <[string "*:OnUpdate"]:1>

Locals:
self = <table> {
 SetDefaultModuleLibraries = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:363
 GetProfessionInfo = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:195
 UpdateModel = <function> defined @Interface\AddOns\FishMaster\scripts/equipment.lua:36
 EnableModule = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:328
 FindSlotInfo = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:73
 CancelTimer = <function> defined @Interface\AddOns\Baggins\Libs\AceTimer-3.0\AceTimer-3.0.lua:147
 IterateEmbeds = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:438
 UnregisterComm = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:143
 CheckEnabled = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:149
 debug = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:63
 Printf = <function> defined @Interface\AddOns\Baggins\Libs\AceConsole-3.0\AceConsole-3.0.lua:65
 IsItemOneHanded = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:225
 SetDefaultModulePrototype = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:405
 SavePosition = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:243
 IsBodySlotOneHanded = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:207
 defaultModuleState = true
 IsEnabled = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:170
 HasPole = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:263
 ScheduleTimer = <function> defined @Interface\AddOns\Baggins\Libs\AceTimer-3.0\AceTimer-3.0.lua:94
 DisableModule = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:346
 FindBestPole = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:272
 GetSlotButton = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:214
 RegisterMessage = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:80
 UnregisterMessage = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:143
 SetFrameText = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:145
 SendCommMessage = <function> defined @Interface\AddOns\BugSack\Libs\AceComm-3.0\AceComm-3.0.lua:83
 Toggle = <function> defined @Interface\AddOns\FishMaster\scripts/main.lua:43
 UnregisterAllComm = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:164
 SetEnabledState = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:420
 enabledState = true
 FindBestLure = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:292
 RegisterEvent = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:80
 SetAudio = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:522
 equipment = <table> {
 }
 IterateModules = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:433
 OffAll = <function> defined @Interface\AddOns\Baggins\Libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:164
 UnsetAudio = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:549
 minimap = <table> {
 }
 Colorize = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:81
 Enable = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:290
 NewModule = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:231
 db = <table> {
 }
 baseName = "FishMaster"
 SlotInfo = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:69
 GetModule = <function> defined @Interface\AddOns\Baggins\Libs\AceAddon-3.0\AceAddon-3.0.lua:206
 Toolbar = <function> defined @Interface\AddOns\FishMaster\scripts/toolbar.lua:15
 FindInSession = <function> defined @Interface\AddOns\FishMaster\scripts/methods.lua:322
 toolbar = 
commented

Figured out the problem, there was missing locals that the function was trying to call. Added this to the ResetOverride function

local toolbar = _G['FishMaster_Toolbar'];
local button = toolbar.cast;

No more errors

commented

This is in Classic Era
Not sure if the coding is that much different, but figured it would help to know