From: Michael Andreen Date: Tue, 2 Feb 2010 16:06:50 +0000 (+0100) Subject: Fix in case planets happens to be 0 X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=c5a19db607b88a8d96a017e56cd92963bf8e69ea Fix in case planets happens to be 0 --- diff --git a/lib/NDWeb/Controller/Stats.pm b/lib/NDWeb/Controller/Stats.pm index e2c784d..9379e99 100644 --- a/lib/NDWeb/Controller/Stats.pm +++ b/lib/NDWeb/Controller/Stats.pm @@ -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)