Quantcast

Gracefully handle recipes which are taught by undefined trainers - the GUI shouldn't crash and burn.

James D. Callahan III [03-06-11 - 22:56]
Gracefully handle recipes which are taught by undefined trainers - the GUI shouldn't crash and burn.
Filename
Interface/List.lua
diff --git a/Interface/List.lua b/Interface/List.lua
index c06bf72..94ae974 100644
--- a/Interface/List.lua
+++ b/Interface/List.lua
@@ -1045,7 +1045,7 @@ function private.InitializeListFrame()
 	local function ExpandTrainerData(entry_index, entry_type, parent_entry, id_num, recipe_id, hide_location, hide_type)
 		local trainer = private.trainer_list[id_num]

-		if not CanDisplayFaction(trainer.faction) then
+		if not trainer or not CanDisplayFaction(trainer.faction) then
 			return entry_index
 		end

@@ -1609,7 +1609,7 @@ do
 	local function Tooltip_AddTrainer(id_num, location, addline_func)
 		local trainer = private.trainer_list[id_num]

-		if location and trainer.location ~= location then
+		if not trainer or (location and trainer.location ~= location) then
 			return
 		end
 		local display_tip, name_color = GetTipFactionInfo(trainer.faction)