Trap exceptions when trying to get the featured wiki page.

This commit is contained in:
Colin Kuskie 2010-08-11 21:47:18 -07:00
parent 996acb5ab5
commit e43745cd86

View file

@ -839,8 +839,8 @@ sub view {
if( @$featuredIds ) {
my $featuredId = $featuredIds->[ int( rand @$featuredIds ) - 1 ];
my $featured = WebGUI::Asset->newById( $session, $featuredId );
if ( $featured ) {
my $featured = eval { WebGUI::Asset->newById( $session, $featuredId ) };
if ( ! Exception::Class->caught() ) {
$self->appendFeaturedPageVars( $var, $featured );
}
}