From 0469445105154236c460fd6decdd0a42121c4419 Mon Sep 17 00:00:00 2001 From: ackis Date: Thu, 15 Jan 2009 18:13:31 +0000 Subject: [PATCH] Add some error checking to make sure the profession isn't nil --- .docmeta | 6 +++++- AckisRecipeList.lua | 15 +++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.docmeta b/.docmeta index a28907c..fed27ab 100644 --- a/.docmeta +++ b/.docmeta @@ -4,4 +4,8 @@ output-page: "Database Documentation" type: wiki input-file: Docs/Main.txt -output-page: "Main" \ No newline at end of file +output-page: "Main" + +type: luadoc +input-file: AckisRecipeList.lua +output-page: "API" \ No newline at end of file diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index 5f8fb6c..cba6ba7 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -1326,13 +1326,16 @@ local function InitializeRecipes(RecipeDB, playerProfession) [GetSpellInfo(53428)] = addon.InitRuneforging, } - -- Thanks to sylvanaar/xinhuan for the code snippet - local a = professiontable[playerProfession] + -- Check for player profession to fix some bugs with addons that interface with ARL + if (playerProfession) then + -- Thanks to sylvanaar/xinhuan for the code snippet + local a = professiontable[playerProfession] - if a then - return a(addon, RecipeDB) - else - addon:Print(L["UnknownTradeSkill"]:format(playerProfession)) + if a then + return a(addon, RecipeDB) + else + addon:Print(L["UnknownTradeSkill"]:format(playerProfession)) + end end end -- 1.7.9.5