fix uninitialized value problem

This occurred when a plugin, loaded earlier, filled out a template in its
checkconfig, before recentchanges's checkconfig had run. Since such a
template won't be a recentchanges template, just test for the value being
uninitialized and skip processing.
master
Joey Hess 2008-06-04 15:00:24 -04:00
parent e4119f048c
commit ea5da19189
1 changed files with 2 additions and 8 deletions

View File

@ -40,14 +40,8 @@ sub pagetemplate (@) { #{{{
my $template=$params{template};
my $page=$params{page};
# XXX this is here because I've been seeing a strange uninitialized
# value in this sub.
if (! defined $config{recentchangespage}) {
eval q{use Carp};
Carp::cluck("undefined recentchangespage; please report this to Joey");
}
if ($config{rcs} && $page ne $config{recentchangespage} &&
if (defined $config{recentchangespage} && $config{rcs} &&
$page ne $config{recentchangespage} &&
$template->query(name => "recentchangesurl")) {
$template->param(recentchangesurl => urlto($config{recentchangespage}, $page));
$template->param(have_actions => 1);