fix: guard nil note/rank from GetGuildRosterInfo on CoA client
GetGuildRosterInfo returns nil for the public-note and rank fields on the CoA Beta client, so ScanGuildNotes crashed at AltNames.lua:331 on strlower(note). Guard note and rank the same way upstream already guards name, and skip the alt-note fallback entirely when there is no note.
This commit is contained in:
@@ -328,7 +328,7 @@ function mod:ScanGuildNotes()
|
||||
for i=1,GetNumGuildMembers(true) do
|
||||
local name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i);
|
||||
local success
|
||||
for word in gmatch(strlower(note), "[%a\128-\255]+") do
|
||||
for word in gmatch(strlower(note or ""), "[%a\128-\255]+") do
|
||||
if names[word] then
|
||||
GUILDNOTES[name] = names[word]
|
||||
success = true
|
||||
@@ -336,9 +336,9 @@ function mod:ScanGuildNotes()
|
||||
break
|
||||
end
|
||||
end
|
||||
if not success and mod.db.profile.altNotesFallback and note~="" then
|
||||
if not success and mod.db.profile.altNotesFallback and note and note~="" then
|
||||
-- #3: no joy? then if this is an 'alt' rank, use the entire note
|
||||
rank=strlower(rank)
|
||||
rank=strlower(rank or "")
|
||||
if strfind(rank, "alt") or
|
||||
strfind(rank, L["alt2"]) or
|
||||
strfind(rank, L["alt3"]) then
|
||||
|
||||
Reference in New Issue
Block a user