diff --git a/CHANGELOG.md b/CHANGELOG.md index f879651f..2d93b52d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v10.2.4 +* Fix: #2154 - Errors when tracking items by slot number when the slot is empty. + ## v10.2.3 * Fix #2148 - Aura Tracking broken in WoW 1.15.1 diff --git a/Components/Core/Common/Item.lua b/Components/Core/Common/Item.lua index 8bd92d2c..11445601 100644 --- a/Components/Core/Common/Item.lua +++ b/Components/Core/Common/Item.lua @@ -133,7 +133,9 @@ function Item:GetCooldown() error("This function must be overridden by subclasses") end function Item:HasUseEffect() - return not not GetItemSpell(self:GetID()) + local id = self:GetID() + if not id then return false end + return not not GetItemSpell(id) end function Item:GetID() error("This function must be overridden by subclasses") @@ -182,6 +184,9 @@ end function Item.NullRef:GetCooldown() return 0, 0, 0 end +function Item.NullRef:HasUseEffect() + return false +end function Item.NullRef:GetID() return 0 end @@ -349,7 +354,9 @@ end function ItemBySlot:IsInRange(unit) - return IsItemInRange(self:GetLink(), unit) + local link = self:GetLink() + if not link then return false end + return IsItemInRange(link, unit) end function ItemBySlot:GetIcon() return GetInventoryItemTexture("player", self.slot) @@ -358,7 +365,9 @@ function ItemBySlot:GetCount() return ItemCount[self:GetID()] end function ItemBySlot:GetEquipped() - return IsEquippedItem(self:GetLink()) + local link = self:GetLink() + if not link then return false end + return IsEquippedItem(link) end function ItemBySlot:GetCooldown() return GetInventoryItemCooldown("player", self.slot) diff --git a/Options/CHANGELOG.lua b/Options/CHANGELOG.lua index af428807..0a23fbc5 100644 --- a/Options/CHANGELOG.lua +++ b/Options/CHANGELOG.lua @@ -3,6 +3,9 @@ if not TMW then return end TMW.CHANGELOG_LASTVER="7.4.0" TMW.CHANGELOG = [==[ +## v10.2.4 +* Fix: #2154 - Errors when tracking items by slot number when the slot is empty. + ## v10.2.3 * Fix #2148 - Aura Tracking broken in WoW 1.15.1 diff --git a/TellMeWhen-Classic.toc b/TellMeWhen-Classic.toc index 6cfd749d..8cf9ed3e 100644 --- a/TellMeWhen-Classic.toc +++ b/TellMeWhen-Classic.toc @@ -18,7 +18,7 @@ ## X-WoWI-ID: 10855 ## X-Wago-ID: ZQ6aZqKW -## Version: 10.2.3 +## Version: 10.2.4 ## Author: Cybeloras of Aerie Peak ## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon ## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick diff --git a/TellMeWhen-Wrath.toc b/TellMeWhen-Wrath.toc index 541fb347..7218fd9b 100644 --- a/TellMeWhen-Wrath.toc +++ b/TellMeWhen-Wrath.toc @@ -18,7 +18,7 @@ ## X-WoWI-ID: 10855 ## X-Wago-ID: ZQ6aZqKW -## Version: 10.2.3 +## Version: 10.2.4 ## Author: Cybeloras of Aerie Peak ## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon ## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick diff --git a/TellMeWhen.toc b/TellMeWhen.toc index d63c8005..af3a8d96 100644 --- a/TellMeWhen.toc +++ b/TellMeWhen.toc @@ -18,7 +18,7 @@ ## X-WoWI-ID: 10855 ## X-Wago-ID: ZQ6aZqKW -## Version: 10.2.3 +## Version: 10.2.4 ## Author: Cybeloras of Aerie Peak ## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon ## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick