From 14c92eff715440242a3414c4bd723b9bdec8aa24 Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Mon, 20 Mar 2017 10:55:00 +0100 Subject: [PATCH] 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. --- wwwroot/cgi-bin/awstats.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = (); -- 2.47.2