fixed: SyndicatedContent asset throws runtime error with RSS feeds it cant deal with

This commit is contained in:
Doug Bell 2008-11-05 19:44:05 +00:00
parent 82706076ec
commit 3045e3f3de

View file

@ -647,10 +647,19 @@ sub view {
}
if(@$rss_feeds == 1){
#One feed. Put in the info from the feed.
$var{'channel.title'} = $rss_feeds->[0]->{channel}->{title} || $title;
$var{'channel.link'} = $rss_feeds->[0]->{channel}->{link};
$var{'channel.description'} = $rss_feeds->[0]->{channel}->{description};
if(@$rss_feeds == 1){
#One feed. Put in the info from the feed.
# Make sure we have a channel to avoid runtime errors
my $channel = $rss_feeds->[0]->{channel};
if ( $channel && ref $channel eq "HASH" ) {
$var{'channel.title'} = $channel->{title} || $title;
$var{'channel.link'} = $channel->{link};
$var{'channel.description'} = $channel->{description};
}
else {
$var{'channel.title'} = $title;
}
}
}
$self->_createRSSURLs(\%var);