From 1b87d4877cd669a1d67904bb391992530984d5a9 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 28 Jan 2010 13:18:04 -0800 Subject: [PATCH] Update Account/Contributions for WebGUI::Definition and exceptions. --- lib/WebGUI/Account/Contributions.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Account/Contributions.pm b/lib/WebGUI/Account/Contributions.pm index 4faad6410..6247c1d38 100644 --- a/lib/WebGUI/Account/Contributions.pm +++ b/lib/WebGUI/Account/Contributions.pm @@ -195,9 +195,13 @@ sub www_view { #Export page to template my @contribs = (); - foreach my $row ( @{$p->getPageData} ) { + ROW: foreach my $row ( @{$p->getPageData} ) { my $assetId = $row->{assetId}; - my $asset = WebGUI::Asset->newById( $session, $assetId ); + my $asset = eval { WebGUI::Asset->newById( $session, $assetId ); }; + if (Exception::Class->caught()) { + $session->log->error("Unable to instanciate assetId $assetId: $@"); + next ROW; + } my $props = $asset->get; $props->{url} = $asset->getUrl; if (ref $asset eq "WebGUI::Asset::Post") {