Quantcast

More failsafes for deconstruct. Should make vendor items not throwing errors. Related to #313

Darthpred [09-04-16 - 05:34]
More failsafes for deconstruct. Should make vendor items not throwing errors. Related to #313
Filename
ElvUI_SLE/modules/professions/deconstruct.lua
diff --git a/ElvUI_SLE/modules/professions/deconstruct.lua b/ElvUI_SLE/modules/professions/deconstruct.lua
index 0f58e7d..bebd33d 100644
--- a/ElvUI_SLE/modules/professions/deconstruct.lua
+++ b/ElvUI_SLE/modules/professions/deconstruct.lua
@@ -199,11 +199,13 @@ function Pr:IsUnlockable(itemLink)
 end

 function Pr:DeconstructParser(...)
+	if not Pr.DeconstructMode then return end
 	local item, link = self:GetItem()
 	local class, subclass = select(6, T.GetItemInfo(item))
 	if not link then return end
 	local itemString = T.match(link, "item[%-?%d:]+")
 	local _, id = T.split(":", itemString)
+	if not id or id == "" then return end
 	if(item and not T.InCombatLockdown()) and (Pr.DeconstructMode == true or (E.global.sle.LOCK.TradeOpen and self:GetOwner():GetName() == "TradeRecipientItem7ItemButton")) then
 		if Pr.DEname then
 			local normalItem = (lib:IsDisenchantable(id) and Pr:IsBreakable(link))