From 79c843434c07511a5c7851b32c7da1d5518d6943 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 26 Jul 2012 15:11:40 -0700 Subject: [PATCH] Fix the unlikely case of empty photo data in a Story asset when purging. --- lib/WebGUI/Asset/Story.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 928984c01..ca554e77a 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -709,7 +709,7 @@ sub purge { ##Delete all storage locations from all revisions of the Asset my $sth = $self->session->db->read("select photo from Story where assetId=?",[$self->getId]); STORAGE: while (my ($json) = $sth->array) { - my $photos = from_json($json); + my $photos = from_json($json || '[]'); PHOTO: foreach my $photo (@{ $photos }) { next PHOTO unless $photo->{storageId}; my $storage = WebGUI::Storage->get($self->session,$photo->{storageId});