
Code Snippets not working (nil value)
Zektos opened this issue ยท 1 comments
Code snippets not showing due to nil value in t["name"]
I fixed it myself locally by changing some code, then deleting the one from the cellDB that had the nil name. The code i did was replacing one line with an if check and just set a name of UnnamedSnippet if nil. The code is Interface/AddOns/Cell/Modules/About/CodeSnippets.lua:295 with:
if t["name"] == nil then
buttons[i].label:SetText(i..".".."UnnamedSnippet")
else
buttons[i].label:SetText(i.."."..t["name"])
end
Stack trace:
Message: Interface/AddOns/Cell/Modules/About/CodeSnippets.lua:295: attempt to concatenate field 'name' (a nil value)
Time: Thu Jan 16 14:43:08 2025
Count: 1
Stack: Interface/AddOns/Cell/Modules/About/CodeSnippets.lua:295: attempt to concatenate field 'name' (a nil value)
[string "@Interface/AddOns/Cell/Modules/About/CodeSnippets.lua"]:295: in function <Interface/AddOns/Cell/Modules/About/CodeSnippets.lua:180>
[string "@Interface/AddOns/Cell/Modules/About/CodeSnippets.lua"]:383: in function `ShowCodeSnippets'
[string "@Interface/AddOns/Cell/Modules/About/About.lua"]:32: in function <Interface/AddOns/Cell/Modules/About/About.lua:31>
Locals: (for state) =
{1 =
}
2 =
}
3 =
}
0 =
}
0 =
}
}
(for control) = 1
i = 1
t =
autorun = true
code = "-- snippets can be found at https://github.com/enderneko/Cell/tree/master/.snippets
-- use "/run CellDB['snippets'][0]=nil ReloadUI()" to reset this snippet
-- cooldown style for icon/block indicators ("VERTICAL", "CLOCK")
CELL_COOLDOWN_STYLE = "VERTICAL"
-- fade out unit button if hp percent > (number: 0-1)
CELL_FADE_OUT_HEALTH_PERCENT = nil
-- add summon icons to Status Icon indicator (boolean, retail only)
CELL_SUMMON_ICONS_ENABLED = false
-- use separate width and height for custom indicator icons (boolean)
CELL_RECTANGULAR_CUSTOM_INDICATOR_ICONS = false
-- Use nicknames from Details! Damage Meter (boolean, NickTag-1.0 library)
CELL_NICKTAG_ENABLED = false
-- remove raid setup details from the tooltip of the Raid button (boolean)
CELL_TOOLTIP_REMOVE_RAID_SETUP_DETAILS = false
-- border thickness: unit button and icon (number)
CELL_BORDER_SIZE = 1
-- unit button border color ({r, g, b, a}, number: 0-1)
CELL_BORDER_COLOR = {0, 0, 0, 1}
-- show raid pet owner name ("VEHICLE", "NAME", nil)
}
(*temporary) = FontString {
}
(*temporary) = 1
(*temporary) = "."
(*temporary) = nil
(*temporary) = -3
(*temporary) = 0
(*temporary) = nil
(*temporary) = "attempt to concatenate field 'name' (a nil value)"
buttons =
1 = Button {
}
0 = Button {
}
}
Cell =
MIN_DEBUFFS_VERSION = 228
MIN_QUICKASSIST_VERSION = 227
flavor = "retail"
funcs =
}
snippetVars =
}
MIN_CLICKCASTINGS_VERSION = 239
IndentationLib =
}
isRetail = true
animations =
}
frames =
}
MIN_INDICATORS_VERSION = 235
unitButtons =
}
versionNum = 243
bFuncs =
}
vars =
}
hasHighestPriority = false
loaded = true
pixelPerfectFuncs =
}
isVanilla = false
version = "r243-release"
isTWW = true
wowSupporters =
}
menu = CellCascadingMenu {
}
supporters1 =
}
MIN_LAYOUTS_VERSION = 239
iFuncs =
}
supporters2 =
}
L =
}
defaults =
}
MIN_VERSION = 220
uFuncs =
}
isWrath = false
isCata = false
}
topPane = Frame {
}
renameEB = EditBox {
height = 20
width = 20
Center = Texture {
}
RightEdge = Texture {
}
backdropInfo =
}
BottomEdge = Texture {
}
BottomLeftCorner = Texture {
}
BottomRightCorner = Texture {
}
TopEdge = Texture {
}
TopRightCorner = Texture {
}
TopLeftCorner = Texture {
}
LeftEdge = Texture {
}
}
selected = 0
forceLoadSelected = true
newBtn = Button {
BottomLeftCorner = Texture {
}
color =
}
RightEdge = Texture {
}
height = 20
hoverColor =
}
tex = Texture {
}
tooltips =
}
_tooltipsInited = true
TopEdge = Texture {
}
bg = Texture {
}
Center = Texture {
}
width = 156
backdropInfo =
}
BottomEdge = Texture {
}
TopRightCorner = Texture {
}
TopLeftCorner = Texture {
}
LeftEdge = Texture {
}
BottomRightCorner = Texture {
}
}
codePane = Frame {
eb = EditBox {
}
scrollFrame = ScrollFrame {
}
}
Getting the same thing. Code fix works though. It was not, in fact, the default config causing the issue (edited).
As an update to this, I found this happens when I import someone else's Cell profile. It attempts to create a copy of the default Cell code snippet, and instead of merging the config with theirs it creates the snippet with no name. Specifically in my case, Swirl's Cell profile is the one that caused the issue for me.
I fixed it using your config, and was able to recover their snippets to use as my own. I simply changed the settings in the default Cell snippet to match theirs in the unnamedsnippet.
One last bit of info -- I've imported the profile a few times since it was put up last year. The most recent attempt was this past week. The last time I attempted was in early January somewhere. Typically I am updating Cell within 24-36 hours of new releases (sometimes less). Just in case that helps narrowing things down.