Quantcast

Fixe for the case where there are no missions running at all

Alar of Daggerspine [04-07-15 - 21:05]
Fixe for the case where there are no missions running at all
Signed-off-by: Alar of Daggerspine <alar@aspide.it>
Filename
GarrisonCommander-Broker/ldb.lua
diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua
index c697adc..8932e17 100644
--- a/GarrisonCommander-Broker/ldb.lua
+++ b/GarrisonCommander-Broker/ldb.lua
@@ -506,11 +506,15 @@ function dataobj:Update()
 			n=n+1
 		end
 	end
-	local c=addon:ColorToString(addon:Gradient(n/t))
-	if (prox and addon:GetBoolean("SHOWNEXT")) then
-		self.text=format("|cff%s%d|r/|cff%s%d|r (%s)",c,n,C.Green.c,t,prox)
+	if t>0 then
+		local c=addon:ColorToString(addon:Gradient(n/t))
+		if (prox and addon:GetBoolean("SHOWNEXT")) then
+			self.text=format("|cff%s%d|r/|cff%s%d|r (%s)",c,n,C.Green.c,t,prox)
+		else
+			self.text=format("|cff%s%d|r/|cff%s%d|r",c,n,C.Green.c,t)
+		end
 	else
-		self.text=format("|cff%s%d|r/|cff%s%d|r",c,n,C.Green.c,t)
+		self.text=NONE
 	end
 end
 function dataobj:OldUpdate()