Quantcast

test if operand is null

Sidoine De Wispelaere [12-18-11 - 17:02]
test if operand is null

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@457 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
diff --git a/Ovale.lua b/Ovale.lua
index 6a7a3ae..88a1cc0 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -2213,6 +2213,10 @@ function Ovale:CalculerMeilleureAction(element)
 	elseif element.type == "operator" then
 		local startA, endA, prioA, elementA = self:CalculerMeilleureAction(element.a)
 		local startB, endB, prioB, elementB = self:CalculerMeilleureAction(element.b)
+		if not elementA or not elementB then
+			self:Log("operator: a or x is nil")
+			return nil
+		end
 		local a = elementA.value
 		local b = elementA.origin
 		local c = elementA.rate