Don't call methods on the first story item when there are no story items.
Fixes #11747.
This commit is contained in:
parent
e033192328
commit
ca5ca46557
2 changed files with 18 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue