From d6316ac4b9d1ac40a480cbf503c4e1464ae0a900 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 14 May 2018 12:01:57 +1000 Subject: [PATCH] add some more protection --- app/models/report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/report.rb b/app/models/report.rb index 9876610426a..0bc05d6cbda 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -438,7 +438,7 @@ class Report trends.each do |trend| ctr = - if trend.click_through == 0 + if trend.click_through == 0 || trend.searches == 0 0 else trend.click_through.to_f / trend.searches.to_f