A malformed pagespec will cause $@ to be set when translated, but if
it is used a second time, the memoization will defeat that check. Better to
check for the result not being defined.
}
my $sub=pagespec_translate($spec);
- return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
+ return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"")
+ if $@ || ! defined $sub;
return $sub->($page, @params);
}