From: Tomaz Solc Date: Mon, 20 Mar 2017 09:55:00 +0000 (+0100) Subject: Fix "Illegal division by zero" error. X-Git-Tag: AWSTATS_7_8~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14c92eff715440242a3414c4bd723b9bdec8aa24;p=thirdparty%2FAWStats.git Fix "Illegal division by zero" error. "$Totalh" is zero when you have downloads with only 206 hits. This commit doesn't draw the graph in such cases. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 091d6823..cf3070f1 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -14306,7 +14306,7 @@ sub HTMLMainDownloads{ if ($cnt > 4){last;} } # Graph the top five in a pie chart - if (scalar keys %_downloads > 1){ + if (($Totalh > 0) and (scalar keys %_downloads > 1)){ foreach my $pluginname ( keys %{ $PluginsLoaded{'ShowGraph'} } ) { my @blocklabel = ();