From 7a4a0be5d438c011adf0f6226470c2ec6b881def Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Fri, 16 Feb 2007 13:52:16 +0000 Subject: [PATCH] fix: Incomplete assets cause manage Trash to fail, added test for valid object creation --- lib/WebGUI/AssetTrash.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index bdc7dd055..94c1b6970 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -79,7 +79,12 @@ sub getAssetsInTrash { assetData.title desc "); while (my ($id, $date, $class) = $sth->array) { - push(@assets, WebGUI::Asset->new($self->session,$id,$class,$date)); + my $asset = WebGUI::Asset->new($self->session,$id,$class,$date); + if ($asset){ + push(@assets, $asset); + }else{ + $self->session->errorHandler->error("AssetTrash::getAssetsInTrash - failed to instanciate asset with assetId $id, className $class, and revisionDate $date"); + } } $sth->finish; return \@assets;