]> ruin.nu Git - ndwebbie.git/commitdiff
Fix in case planets happens to be 0
authorMichael Andreen <harv@ruin.nu>
Tue, 2 Feb 2010 16:06:50 +0000 (17:06 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 2 Feb 2010 16:06:50 +0000 (17:06 +0100)
lib/NDWeb/Controller/Stats.pm

index e2c784d929bb837f33c5504e12dbd2db87d0d236..9379e99c0aa8574835eb86ddee63728bf49dae7a 100644 (file)
@@ -62,7 +62,7 @@ FROM galaxies g
                        GROUP BY raid,p.tick,x,y
                        ) AS a
                        JOIN galaxies g USING (tick,x,y)
-               WHERE a.count::float / g.planets >= 0.5
+               WHERE a.count::float / NULLIF(g.planets,0) >= 0.5
                ORDER BY x,y,tick
        ) AS raid USING (x,y)