diff Export.lua @ 91:b8e9664d3229 v43

option to disable equipment manager sets, minor artifact/talent bug fixes
author yellowfive
date Wed, 21 Sep 2016 00:14:22 -0700
parents 6bbe64d587b4
children e635cd648e01
line wrap: on
line diff
--- a/Export.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Export.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -270,6 +270,8 @@
 end
 
 local function scanArtifact()
+	if not Amr.db or not Amr.db.char or not Amr.db.char.Artifacts then return end
+	
 	local powers = C_ArtifactUI.GetPowers()
 	if not powers then return end
 	
@@ -292,14 +294,16 @@
 	if not powers then return end
 	
 	-- use the artifact item ID to figure out which spec this is for, since you can open your artifact on any spec
-	local itemID = C_ArtifactUI.GetArtifactInfo()
+	local itemID = C_ArtifactUI.GetArtifactInfo()	
 	local spec = Amr.ArtifactIdToSpecNumber[itemID]	
 	--local spec = GetSpecialization()
 	
-	Amr.db.char.Artifacts[spec] = {
-		Powers = powerRanks,
-		Relics = relicInfo
-	}
+	if spec then
+		Amr.db.char.Artifacts[spec] = {
+			Powers = powerRanks,
+			Relics = relicInfo
+		}
+	end
 end
 
 -- Returns a data object containing all information about the current player needed for an export: