cleanup nil error if account is GM

This commit is contained in:
Crum
2018-06-06 23:43:10 -05:00
parent 265b0559f8
commit cd7ea3556e
2 changed files with 4 additions and 6 deletions
+2 -1
View File
@@ -15,7 +15,6 @@ local GetActiveTalentGroup = GetActiveTalentGroup
local GetCVar = GetCVar
local GetFunctionCPUUsage = GetFunctionCPUUsage
local GetTalentTabInfo = GetTalentTabInfo
local InCombatLockdown = InCombatLockdown
local IsAddOnLoaded = IsAddOnLoaded
local IsInInstance, GetNumPartyMembers, GetNumRaidMembers = IsInInstance, GetNumPartyMembers, GetNumRaidMembers
local RequestBattlefieldScoreData = RequestBattlefieldScoreData
@@ -28,6 +27,8 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS
_, E.myclass = UnitClass("player") -- Constants
_, E.myrace = UnitRace("player")
_, E.myfaction = UnitFactionGroup("player")
-- The E.myfaction may error when in GM mode
E.myfaction = E.myfaction or "Others"
E.myname = UnitName("player")
E.version = GetAddOnMetadata("ElvUI", "Version")
E.myrealm = GetRealmName()
+2 -5
View File
@@ -5,7 +5,6 @@ local AFK = E:NewModule("AFK", "AceEvent-3.0", "AceTimer-3.0");
--Cache global variables
--Lua functions
local _G = _G
local GetTime = GetTime
local floor = math.floor
--WoW API / Variables
local CinematicFrame = CinematicFrame
@@ -14,12 +13,12 @@ local GetBattlefieldStatus = GetBattlefieldStatus
local GetGuildInfo = GetGuildInfo
local GetScreenHeight = GetScreenHeight
local GetScreenWidth = GetScreenWidth
local GetTime = GetTime
local UnitAffectingCombat = UnitAffectingCombat
local IsInGuild = IsInGuild
local IsShiftKeyDown = IsShiftKeyDown
local Screenshot = Screenshot
local SetCVar = SetCVar
local UnitFactionGroup = UnitFactionGroup
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES
@@ -284,11 +283,9 @@ function AFK:Initialize()
E:Size(self.AFKMode.bottom.logo, 320, 150)
E:Point(self.AFKMode.bottom.logo, "CENTER", self.AFKMode.bottom, "CENTER", 0, 50)
self.AFKMode.bottom.logo:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\logo")
local factionGroup = UnitFactionGroup("player")
self.AFKMode.bottom.faction = self.AFKMode.bottom:CreateTexture(nil, "OVERLAY")
E:Point(self.AFKMode.bottom.faction, "BOTTOMLEFT", self.AFKMode.bottom, "BOTTOMLEFT", -20, -16)
self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..factionGroup.."-Logo")
self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..E.myfaction.."-Logo")
E:Size(self.AFKMode.bottom.faction, 140)
self.AFKMode.bottom.name = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")