]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix "Illegal division by zero" error. 64/head
authorTomaz Solc <tomaz.solc@tablix.org>
Mon, 20 Mar 2017 09:55:00 +0000 (10:55 +0100)
committerTomaz Solc <tomaz.solc@tablix.org>
Mon, 20 Mar 2017 09:55:00 +0000 (10:55 +0100)
"$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

index 091d6823f3c230f9eefb252e39a5d22a15b8dcb0..cf3070f1978782feb8eeabe9318a13be4349a57e 100755 (executable)
@@ -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 = ();