Handle the case when purging a story, and there's no storage location.

This commit is contained in:
Colin Kuskie 2009-03-03 23:50:45 +00:00
parent e5c56dcf70
commit 2f0b2638cf
2 changed files with 74 additions and 4 deletions

View file

@ -262,7 +262,8 @@ Cleaning up storage objects in all revisions.
sub purge {
my $self = shift;
my $sth = $self->session->db->read("select storageId from Story where assetId=".$self->session->db->quote($self->getId));
while (my ($storageId) = $sth->array) {
STORAGE: while (my ($storageId) = $sth->array) {
next STORAGE unless $storageId;
WebGUI::Storage->get($self->session,$storageId)->delete;
}
$sth->finish;