diff --git a/AethysCore/Class/Unit/Player/Instance.lua b/AethysCore/Class/Unit/Player/Instance.lua index 1c1bb309..170e2b55 100644 --- a/AethysCore/Class/Unit/Player/Instance.lua +++ b/AethysCore/Class/Unit/Player/Instance.lua @@ -66,14 +66,18 @@ local GetInstanceInfo = GetInstanceInfo; local function _GetInstanceInfo () return {GetInstanceInfo()}; end function Player:InstanceInfo () - local Infos = Cache.Get("UnitInfo", self:GUID(), "InstanceInfo", _GetInstanceInfo); - if Infos then - if Index then - return Infos[Index]; - else - return unpack(Infos); + local GUID = self:GUID(); + if GUID then + local Infos = Cache.Get("UnitInfo", GUID, "InstanceInfo", _GetInstanceInfo); + if Infos then + if Index then + return Infos[Index]; + else + return unpack(Infos); + end end end + return nil; end end diff --git a/AethysCore/Class/Unit/Player/Main.lua b/AethysCore/Class/Unit/Player/Main.lua index 86b92743..179d6adf 100644 --- a/AethysCore/Class/Unit/Player/Main.lua +++ b/AethysCore/Class/Unit/Player/Main.lua @@ -34,8 +34,12 @@ local UnitID; local function _UnitRace () return select(2, UnitRace(UnitID)); end function Player:Race () - UnitID = self.UnitID; - return Cache.Get("UnitInfo", self:GUID(), "Race", _UnitRace); + local GUID = self:GUID(); + if GUID then + UnitID = self.UnitID; + return Cache.Get("UnitInfo", GUID, "Race", _UnitRace); + end + return nil; end end