From 3b2ed240d0ab9d1097be5432ccc878d842f262ef Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 3 Jan 2009 00:19:33 +0000 Subject: [PATCH] Avoid division by zero --- maintenance/storage/orphanStats.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maintenance/storage/orphanStats.php b/maintenance/storage/orphanStats.php index 77bf465d08..afea815e78 100644 --- a/maintenance/storage/orphanStats.php +++ b/maintenance/storage/orphanStats.php @@ -36,9 +36,11 @@ class OrphanStats { } unset( $res ); - echo "Number of orphans: $num\n" . - "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" . + echo "Number of orphans: $num\n"; + if ( $num > 0 ) { + echo "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" . "Max size: $maxSize\n" . "Number of unique texts: " . count( $hashes ) . "\n"; + } } } -- 2.20.1