Skip to content

A platform for community discussion. Free, open, simple.

add some more protection

Samd6316ac4b9d1
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