From: Chuck Hagenbuch Date: Fri, 20 Aug 2010 04:49:54 +0000 (-0400) Subject: Don't trigger an exception if there are just no images X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f44877b26782e769dcb8dfc2130bc5dedda75d16;p=horde.git Don't trigger an exception if there are just no images --- diff --git a/ansel/lib/GalleryMode/Date.php b/ansel/lib/GalleryMode/Date.php index ba7b2fe6d..d249539f2 100644 --- a/ansel/lib/GalleryMode/Date.php +++ b/ansel/lib/GalleryMode/Date.php @@ -287,8 +287,12 @@ class Ansel_GalleryMode_Date extends Ansel_GalleryMode_Base if (!empty($gallery_where)) { $where .= ' AND ' . $gallery_where; } - $images= $ansel_storage->listImages($this->_gallery->id, $from, $to, 'image_id', $where, 'image_sort'); - $results = $ansel_storage->getImages(array('ids' => $images, 'preserve' => true)); + $images = $ansel_storage->listImages($this->_gallery->id, $from, $to, 'image_id', $where, 'image_sort'); + if ($images) { + $results = $ansel_storage->getImages(array('ids' => $images, 'preserve' => true)); + } else { + $results = array(); + } if ($this->_gallery->get('has_subgalleries')) { $images = array();