Quantcast

Avoid nil GUIDs.

Johnny C. Lam [10-28-12 - 23:58]
Avoid nil GUIDs.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@633 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index ec2b5fb..5bd5acf 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -175,7 +175,18 @@ function OvaleAura:UpdateAuras(unitId, unitGUID)
 	local hateClasse
 	local damageMultiplier

-	if not unitId then return end
+	if not unitId then
+		return
+	end
+	if not unitGUID and unitId == "player" then
+		unitGUID = self.playerGUID
+	end
+	if not unitGUID then
+		unitGUID = UnitGUID(unitId)
+	end
+	if not unitGUID then
+		return
+	end

 	if unitId == "player" then
 		hateBase = GetCombatRatingBonus(18)
@@ -186,13 +197,6 @@ function OvaleAura:UpdateAuras(unitId, unitGUID)
 		hateClasse = 0
 		damageMultiplier = 1
 	end
-
-	if not unitGUID and unitId == "player" then
-		unitGUID = self.playerGUID
-	end
-	if not unitGUID then
-		unitGUID = UnitGUID(unitId)
-	end

 	if not self.aura[unitGUID] then
 		self.aura[unitGUID] = {}