New release

Leandro Silva [11-12-18 - 21:16]
New release
Filename
LeoGuildManagerUI.lua
diff --git a/LeoGuildManagerUI.lua b/LeoGuildManagerUI.lua
index bf4eec7..0223342 100644
--- a/LeoGuildManagerUI.lua
+++ b/LeoGuildManagerUI.lua
@@ -142,18 +142,20 @@ local function removeEndangered(member, control)
     if control == nil then
         control = findCheckboxByName(member)
     end
-    control:SetTexture('/esoui/art/buttons/checkbox_unchecked.dds')
-    control.isEndangered = false
+    if control ~= nil then
+        control:SetTexture('/esoui/art/buttons/checkbox_unchecked.dds')
+        control.isEndangered = false
+    end
 end

 local function demoteNext()
+    local guildId = LeoGuildManager.GetGuildId(LeoGuildManager.globalData.selectedGuild)
     for i, member in pairs(LeoGuildManager.endangered) do
         LeoGuildManager.log("Demoting " .. member .. " ...")
         GuildDemote(guildId, member)
         table.remove(LeoGuildManager.endangered, i)
         removeEndangered(member)

-        local guildId = LeoGuildManager.GetGuildId(LeoGuildManager.globalData.selectedGuild)
         LeoGuildManager.UpdateMemberRank(guildId, member)

         LeoGuildManagerMemberList:RefreshData()
@@ -163,6 +165,7 @@ local function demoteNext()
 end

 local function kickNext()
+    local guildId = LeoGuildManager.GetGuildId(LeoGuildManager.globalData.selectedGuild)
     for i, member in pairs(LeoGuildManager.endangered) do
         LeoGuildManager.log("Removing " .. member .. " ...")
         GuildRemove(guildId, member)