Error running WeakAuras.WA_Utf8Sub()
celdorwow opened this issue ยท 0 comments
Describe the bug
Expected a shortened string from this function: WeakAuras.WA_Utf8Sub(input, size)
.
To Reproduce
Tested the following lua code:
local tbl_loc = {
"Cathedral Square",
"Dwarven District",
"Old Town",
"Trade District",
"Mage Quarter",
"Valley of Strength",
"Valley of Spirits",
"Valley of Wisdom",
"The Drag",
"Valley of Honor",
"Crystals",
"Crystal",
"Chests",
"Chest",
"Subzones",
"You have crystals to turn in",
}
print("-- BEGIN")
local size = 5 -- 5 is only an example, other numbers also cause error
for _,v in ipairs(tbl_loc) do print(v, WeakAuras.WA_Utf8Sub(v,size)) end
print("-- END")
Do you have an error log of what happened?
Interface\AddOns\WeakAuras\AuraEnvironment.lua:116: attempt to compare number with nil
**Steps to reproduce the behaviour:
I tested the above code inside /wowlua
window and get the error when passing specific numbers as a second parameter size
, e.g. 5, 6, 7, 8, 12, 14, 15, 16, 17.
Did you try having WeakAuras as the only enabled addon and everything else (especially something like ElvUI) disabled?
Yes.
Which version of WeakAuras are you using?
2.17.11
Are you on World of Warcraft Classic or Retail?
- Retail
Was it working in a previous version? If yes, which was the last good one?
I have not tested the function in any previous version of WA.
Additional notes
The error seems to occur when size
is greater than a number of characters in the input
.