changeset 23:8acb6dc1ff9e

Avoid a lua error when the reagent is not found
author contrebasse
date Wed, 27 Apr 2011 21:55:33 +0200
parents a5a3e5e14ef7
children 5f3a5b88fb19
files ReagentMaker.lua
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ReagentMaker.lua	Wed Apr 27 19:14:06 2011 +0200
+++ b/ReagentMaker.lua	Wed Apr 27 21:55:33 2011 +0200
@@ -42,7 +42,7 @@
 
 		-- Scan availabe recipes
 		A:ScanSimpleRecipes()
-		
+
 		-- Show makables reagents
 		A.updateCounts(GetTradeSkillSelectionIndex())
 	end
@@ -203,7 +203,10 @@
 	if A.data[reagentID].spell then
 		link = GetSpellLink(A.data[reagentID].spellID)
 	else
-		link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID))
+		local index = A.findSkillIndex(reagentID)
+		if index then
+			link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID))
+		end
 	end
 	if link then
 		A.tooltipRecipe:SetOwner(btn)