From c397cc73bef3bf2a092e1f0ddf73fd415db49da3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 12 May 2009 04:22:05 +0000 Subject: Don't divide by zero if there are no photos in the Gallery. --- modules/exif/helpers/exif_task.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/exif/helpers') diff --git a/modules/exif/helpers/exif_task.php b/modules/exif/helpers/exif_task.php index 3ca849f9..e5e70305 100644 --- a/modules/exif/helpers/exif_task.php +++ b/modules/exif/helpers/exif_task.php @@ -83,6 +83,9 @@ class exif_task_Core { private static function _get_stats() { $missing_exif = ORM::factory("exif_record")->where("dirty", 1)->count_all(); $total_items = ORM::factory("item")->where("type", "photo")->count_all(); + if (!$total_items) { + return array(0, 0, 0); + } return array($missing_exif, $total_items, round(100 * (($total_items - $missing_exif) / $total_items))); } -- cgit v1.2.3