Fix possible nil when portaling

This commit is contained in:
Robin 2021-02-06 19:10:40 +01:00
parent ce23a9097a
commit 7da426ce64
1 changed files with 5 additions and 3 deletions

View File

@ -13,9 +13,11 @@ local defaults = {
local function myGuild(unitname)
for i=1,GetNumGuildMembers() do
local rostername, _, _, _, _, _, _, _, online = GetGuildRosterInfo(i)
local shortname = strsplit("-",rostername,2)
if(online and (rostername == unitname or shortname == unitname)) then
return true
if(rostername) then
local shortname = strsplit("-",rostername,2)
if(online and (rostername == unitname or shortname == unitname)) then
return true
end
end
end
return false