Fix the RootTitle macro.
This commit is contained in:
parent
c1c4256d06
commit
193d30ec41
2 changed files with 11 additions and 15 deletions
|
|
@ -12,6 +12,7 @@ package WebGUI::Macro::RootTitle;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Exception;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -40,9 +41,13 @@ sub process {
|
|||
|
||||
##Get my root.
|
||||
$lineage = substr($lineage,0,12);
|
||||
my $root = WebGUI::Asset->newByLineage($session,$lineage);
|
||||
my $root = eval { WebGUI::Asset->newByLineage($session,$lineage); };
|
||||
|
||||
if (Exception::Class->caught()) {
|
||||
$session->log->error('RootTitle macro: '.$@);
|
||||
return "";
|
||||
}
|
||||
|
||||
return "" unless defined $root;
|
||||
return $root->get("title");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue