From e3313951b25b44c0ac6582fa33d6da0d0ddbe1ba Mon Sep 17 00:00:00 2001
From: sgiehl <stefan@piwik.org>
Date: Sun, 9 Mar 2014 21:47:38 +0100
Subject: [PATCH] prevent division by zero for 0 value

---
 plugins/Insights/InsightReport.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/Insights/InsightReport.php b/plugins/Insights/InsightReport.php
index 759f7bf5a8..7c62df9344 100644
--- a/plugins/Insights/InsightReport.php
+++ b/plugins/Insights/InsightReport.php
@@ -64,7 +64,7 @@ class InsightReport
             $minNewPercent         = 5;
         }
 
-        if ($totalValue < 200) {
+        if ($totalValue < 200 && $totalValue > 0) {
             // force at least a change of 2 visits
             $minMoversPercent = (int) ceil(2 / ($totalValue / 100));
             $minNewPercent    = max($minNewPercent, $minMoversPercent);
-- 
GitLab