From 0efc6514e3be6cfb963cdeff586cdb93b85b1875 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 29 Jun 2010 13:50:36 -0700 Subject: [PATCH] Don't call asset methods on undef in the GalleryAlbum. Fixes bug #11681. --- docs/changelog/7.x.x.txt | 2 +- lib/WebGUI/Asset/Wobject/GalleryAlbum.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 1448ebd90..1726a4b2d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,7 +12,7 @@ - fixed #11678: Story Archive leaks version tags - fixed #11671: Approving version tags takes up 1 to hour to take affect. - fixed #11663: More detail section of image gallery - + - fixed #11681: Gallery album chokes on photo w/ missing properties 7.9.7 - added #11571: Allow return from photo edit view to gallery edit view diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index 9d600c6f7..7387c1bd2 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -230,8 +230,9 @@ sub appendTemplateVarsFileLoop { my $assetIds = shift; my $session = $self->session; - for my $assetId (@$assetIds) { + ASSET: for my $assetId (@$assetIds) { my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId); + next ASSET unless $asset; # Set the parent $asset->{_parent} = $self; push @{$var->{file_loop}}, $asset->getTemplateVars;