]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Controller/Stats.pm
Fix in case planets happens to be 0
[ndwebbie.git] / 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)