View Single Post
11-21-21, 06:24 PM   #1
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Two related errors that are confusing me

Attached is the retail zip of RepByZone in progress. As it stands, I'm getting the following error:
Lua Code:
  1. 5x stack overflow
  2. [string "=[C]"]: in function `GetBestMapForUnit'
  3. [string "@RepByZone\Core-Retail.lua"]:444: in function `SwitchedZones'
  4. [string "@RepByZone\Core-Retail.lua"]:329: in function `CheckSholazarBasin'
  5. [string "@RepByZone\Data-Retail.lua"]:13: in function `ZoneAndFactionList'
  6. [string "@RepByZone\Core-Retail.lua"]:450: in function `SwitchedZones'
  7. [string "@RepByZone\Core-Retail.lua"]:329: in function `CheckSholazarBasin'
  8. [string "@RepByZone\Data-Retail.lua"]:13: in function `ZoneAndFactionList'
  9. [string "@RepByZone\Core-Retail.lua"]:450: in function `SwitchedZones'
  10. [string "@RepByZone\Core-Retail.lua"]:329: in function `CheckSholazarBasin'
  11. [string "@RepByZone\Data-Retail.lua"]:13: in function `ZoneAndFactionList'
  12. [string "@RepByZone\Core-Retail.lua"]:450: in function `SwitchedZones'
  13. [string "@RepByZone\Core-Retail.lua"]:329: in function `CheckSholazarBasin'
  14. ...
  15. [string "=[C]"]: ?
  16. [string "@ElvUI_SLE\core\toolkit.lua"]:265: in function `InitializeModules'
  17. [string "@ElvUI_SLE\core\core.lua"]:126: in function `?'
  18. [string "@ElvUI\Core\Libraries\LibElvUIPlugin-1.0\LibElvUIPlugin-1.0-38.lua"]:306: in function <...\Libraries\LibElvUIPlugin-1.0\LibElvUIPlugin-1.0.lua:302>
  19. [string "=[C]"]: in function `Initialize'
  20. [string "@ElvUI\Core\init.lua"]:168: in function <ElvUI\Core\init.lua:167>
  21. [string "=[C]"]: ?
  22. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:70: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:65>
  23. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:527: in function `EnableAddon'
  24. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:630: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:615>
The function RepByZone:SwitchedZones() is where the problems lie, and I can't figure them out. In that function, I added the following lines, which seem to be causing the stack overflow. These lines did not exist previously, because the tables are assigned values in the OnEnable() function.
Lua Code:
  1. instancesAndFactions = instancesAndFactions or self:InstancesAndFactionList()
  2. zonesAndFactions = zonesAndFactions or self:ZoneAndFactionList()
  3. subZonesAndFactions = subZonesAndFactions or self:SubZonesAndFactions()
However, if I remove those lines in SwitchedZones(), I get the error below, which didn't exist until two days ago. Again, this doesn't make sense to me, since the tables are not nil.
Lua Code:
  1. 5x RepByZone\Core-Retail.lua:452: bad argument #1 to 'pairs' (table expected, got nil)
  2. [string "=[C]"]: in function `pairs'
  3. [string "@RepByZone\Core-Retail.lua"]:452: in function `SwitchedZones'
  4. [string "@RepByZone\Core-Retail.lua"]:329: in function `CheckSholazarBasin'
  5. [string "@RepByZone\Data-Retail.lua"]:13: in function `ZoneAndFactionList'
  6. [string "@RepByZone\Core-Retail.lua"]:152: in function <RepByZone\Core-Retail.lua:140>
  7. [string "=[C]"]: ?
  8. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:70: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:65>
  9. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:527: in function `EnableAddon'
  10. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:630: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:615>
  11. [string "=[C]"]: in function `LoadAddOn'
  12. [string "@ElvUI_SLE\modules\professions\professions.lua"]:38: in function <ElvUI_SLE\modules\professions\professions.lua:35>
  13. [string "=[C]"]: ?
  14. [string "@ElvUI_SLE\core\toolkit.lua"]:265: in function `InitializeModules'
  15. [string "@ElvUI_SLE\core\core.lua"]:126: in function `?'
  16. [string "@ElvUI\Core\Libraries\LibElvUIPlugin-1.0\LibElvUIPlugin-1.0-38.lua"]:306: in function <...\Libraries\LibElvUIPlugin-1.0\LibElvUIPlugin-1.0.lua:302>
  17. [string "=[C]"]: in function `Initialize'
  18. [string "@ElvUI\Core\init.lua"]:168: in function <ElvUI\Core\init.lua:167>
  19. [string "=[C]"]: ?
  20. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:70: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:65>
  21. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:527: in function `EnableAddon'
  22. [string "@Ace3\AceAddon-3.0\AceAddon-3.0-13.lua"]:630: in function <Ace3\AceAddon-3.0\AceAddon-3.0.lua:615>
I honestly do not understand why either error exists, nor do I understand how to fix them. The three extra lines do not exist in the copy that users would download and install, and there are no errors in that version. The difference is that I added Warlords of Draenor data, and an option for the user to choose between watching the assigned zone factions or their bodyguard's faction, if a bodyguard is applied to the baracks.

Please send help! I've run out of ideas.
Attached Files
File Type: zip RepByZone.zip (280.5 KB, 101 views)
  Reply With Quote