UIDropDownMenu Assumed Taint
I try to avoid posting bothering people on here with something that is probably trivial but I'm stumped and at my whits end. As far as I know this was working fine with 8.1 and 8.2 so maybe I missed something about API changes with 8.3.
Basically I'm getting the following in at least 2 places that have been found so far. https://github.com/kaytotes/Improved...dUI/issues/139 https://github.com/kaytotes/Improved...dUI/issues/140 Clicking "Guild" on my micro menu. The specific line in question being: https://github.com/kaytotes/Improved....lua#L108-L112 Code:
29x FrameXML\UIDropDownMenu.lua:340: attempt to index local 'listFrame' (a nil value) Code:
31x FrameXML\UIDropDownMenu.lua:340: attempt to index local 'listFrame' (a nil value) https://www.wowace.com/projects/libuidropdownmenu https://www.wowinterface.com/downloa...pDownMenu.html I build the micro menu here: https://github.com/kaytotes/Improved...romenu.lua#L39 Use it here: https://github.com/kaytotes/Improved...romenu.lua#L69 Swapping those out for the above replacements however hasn't solved the problem that I expected. I am using the following 3rd party libs and wondered if maybe they could somehow be a cause but doubt it: LibStub, Ace3, CallbackHandler-1.0, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets. Basically. What am I doing wrong? |
This is not a taint, since the error message say the "listFrame" doesn't existed, so according to the code line
Lua Code:
The ui drop down menu provided by the blz has only two levels, limited by "UIDROPDOWNMENU_MAXLEVELS". So if you want use more levels, the error will be raised. I don't check the 3rd libs, according to the page, if you use NoTaint UIDropDownMenu, you may change the LIB_UIDROPDOWNMENU_MAXLEVELS to a more big value. If you still have problem, I also have a lib for drop down menu, you can search ShowDropDownMenu in https://github.com/kurapica/Scorpio/.../004.widget.md |
I'm sorry but I do not understand your solution. Changing that constant doesn't solve the problem either and I still get the listFrame error.
My question is why am I getting this error? I don't even know what a listframe is. |
There is a huge bug IMO in the blizzard code.
ClubFinder.lua:559 Lua Code:
In this code "level" is a GLOBAL! This means that it could be interacting with other code that sets the global "level" variable! So if you are lucky that level variable will be nil, and when you call into AddButton, it will get set to 1 by this code Lua Code:
So, that is all well and good - but it is breaking for you. So let check out your code to see if you might be using the same variable. https://sourcegraph.com/github.com/k...yer.lua#L121:5 You also appear to be writing to the global "level" variable Lua Code:
You should try to avoid writing to global variables if at all possible. Cheers! |
Oh my god that's it as soon as I saw it clicked.
I'd just been going through my .TOC file and removing modules line by line to find a culprit for the error and narrowed it down to my player.lua and target.lua I'll make a far more concerted effort to use local wherever appropriate! Thank you so much i've been tearing my hair out for a couple weeks. |
Quote:
don't forget you can also use addon wide variables via the shared table you can access at the top of each lua file. If you have never used it, do something similar to the following at the top of any file you want to access the addon wide table. The second line is just something I add in case it is initially nil rather than an empty table. local addonName, addonData = ... addonData = addonData or {} I use local for variables that are only needed for that file, or within code blocks and anything that I need access to across the whole addon I used the addonData table. This enables me to separate functionality across multiple files, which enables me to better share individual files with other addons that need the same functionality. Such as Translation tools. |
Dont feel bad ;) it seems there are quite some addons using level as a global ...
https://www.townlong-yak.com/globe/wut/#q:level |
All times are GMT -6. The time now is 05:00 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI