Skip to content

Commit

Permalink
Fix the unlikely case of empty photo data in a Story asset when purging.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jul 26, 2012
1 parent c120a8b commit 79c8434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WebGUI/Asset/Story.pm
Expand Up @@ -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});
Expand Down

0 comments on commit 79c8434

Please sign in to comment.