Fix the unlikely case of empty photo data in a Story asset when purging.

This commit is contained in:
Colin Kuskie 2012-07-26 15:11:40 -07:00
parent c120a8b28d
commit 79c843434c

View file

@ -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});