]> source.dussan.org Git - archiva.git/commitdiff
[MRM-353] fix for divide by zero error...
authorJesse McConnell <jmcconnell@apache.org>
Wed, 23 May 2007 22:52:51 +0000 (22:52 +0000)
committerJesse McConnell <jmcconnell@apache.org>
Wed, 23 May 2007 22:52:51 +0000 (22:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@541112 13f79535-47bb-0310-9956-ffa450edef68

archiva-base/archiva-model/src/main/mdo/archiva-base.xml

index 16bd14693297dac88b15873ccd97bca26cb2e008..da0f0b2f28a8bb6c28878d033e421ad6d4d67966 100644 (file)
         }
             
         buf.append( "\n  Total File Count  : " ).append( this.getTotalFileCount() );
-        long averageMsPerFile = ( this.getDuration() / this.getTotalFileCount() );
+        
+        long averageMsPerFile = 0;
+        
+        if ( this.totalFileCount != 0 )
+        {
+            averageMsPerFile = ( this.getDuration() / this.getTotalFileCount() );
+        }
+        
         buf.append( "\n  Avg Time Per File : " );
         buf.append( org.apache.maven.archiva.common.utils.DateUtil.getDuration( averageMsPerFile ) );
         buf.append( "\n______________________________________________________________" );