Fix the RootTitle macro.

This commit is contained in:
Colin Kuskie 2010-01-27 21:38:12 -08:00
parent c1c4256d06
commit 193d30ec41
2 changed files with 11 additions and 15 deletions

View file

@ -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");
}