Trap exceptions when trying to get the featured wiki page.
This commit is contained in:
parent
996acb5ab5
commit
e43745cd86
1 changed files with 2 additions and 2 deletions
|
|
@ -839,8 +839,8 @@ sub view {
|
||||||
|
|
||||||
if( @$featuredIds ) {
|
if( @$featuredIds ) {
|
||||||
my $featuredId = $featuredIds->[ int( rand @$featuredIds ) - 1 ];
|
my $featuredId = $featuredIds->[ int( rand @$featuredIds ) - 1 ];
|
||||||
my $featured = WebGUI::Asset->newById( $session, $featuredId );
|
my $featured = eval { WebGUI::Asset->newById( $session, $featuredId ) };
|
||||||
if ( $featured ) {
|
if ( ! Exception::Class->caught() ) {
|
||||||
$self->appendFeaturedPageVars( $var, $featured );
|
$self->appendFeaturedPageVars( $var, $featured );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue