fix: getLineageLength called on undef in case no pages are in the nav loop

This commit is contained in:
Martin Kamerbeek 2008-08-24 11:00:21 +00:00
parent 5603871713
commit 8263e0a0c6

View file

@ -401,7 +401,13 @@ sub view {
my $currentLineage = $current->get("lineage");
my $lineageToSkip = "noskip";
my $absoluteDepthOfLastPage;
my $absoluteDepthOfFirstPage = $assets->[0]->getLineageLength;
# Get the lineage 'depth' of the first asset if there are any assets at all
my $absoluteDepthOfFirstPage = exists $assets->[0]
? $assets->[0]->getLineageLength
: 0
;
my %lastChildren;
my $previousPageData = undef;
my $eh = $self->session->errorHandler;