From 2ca39d79862f86065cd2675eab3b795cc8e02411 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 23 Oct 2012 02:43:14 +0000 Subject: protect from albums with no container. --- views/default/object/album/gallery.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'views/default/object/album/gallery.php') diff --git a/views/default/object/album/gallery.php b/views/default/object/album/gallery.php index 53194b53c..d6fb598e4 100644 --- a/views/default/object/album/gallery.php +++ b/views/default/object/album/gallery.php @@ -10,6 +10,7 @@ $album = elgg_extract('entity', $vars); + $album_cover = elgg_view_entity_icon($album, 'small'); $header = elgg_view('output/url', array( @@ -19,11 +20,14 @@ $header = elgg_view('output/url', array( 'class' => 'tidypics-heading', )); -$footer = elgg_view('output/url', array( - 'text' => $album->getContainerEntity()->name, - 'href' => $album->getContainerEntity()->getURL(), - 'is_trusted' => true, -)); +$footer = ""; +if ($album->getContainerEntity()) { + $footer .= elgg_view('output/url', array( + 'text' => $album->getContainerEntity()->name, + 'href' => $album->getContainerEntity()->getURL(), + 'is_trusted' => true, + )); +} $footer .= '
' . elgg_echo('album:num', array($album->getSize())) . '
'; $params = array( -- cgit v1.2.3