Don't call methods on the first story item when there are no story items.

Fixes #11747.
This commit is contained in:
Scott Walters 2010-07-27 19:16:00 -04:00
parent e033192328
commit ca5ca46557
2 changed files with 18 additions and 2 deletions

View file

@ -220,7 +220,7 @@ sub viewTemplateVariables {
push @{$var->{story_loop}}, $storyVars;
}
if ($self->{_standAlone}) {
if ($self->{_standAlone} and @$storyIds) {
my $topStoryData = $storyIds->[0];
shift @{ $var->{story_loop} };
##Note, this could have saved from the loop above, but this looks more clean and encapsulated to me.