From a5202ff8f416b327a26df87d0e92dd4ccdb8c084 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 20 Mar 2009 20:57:15 +0000 Subject: defensive coding for empty album --- views/default/object/album.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'views/default/object') diff --git a/views/default/object/album.php b/views/default/object/album.php index b95d55eed..9d3dc507f 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -111,14 +111,15 @@ //build array for back | next links $_SESSION['image_sort'] = array(); - foreach($count as $image){ - array_push($_SESSION['image_sort'], $image->guid); - } + if(count($count) > 0) { + foreach($count as $image){ + array_push($_SESSION['image_sort'], $image->guid); + } - if(count($count) > 0) echo list_entities("object","image", $file_guid, 24, false); - else + } else { echo elgg_echo('image:none'); + } ?>
-- cgit v1.2.3