diff --git a/cf/w32-hh-toc-from-info.pl b/cf/w32-hh-toc-from-info.pl index 2207c5cf4..9be8ef6e7 100644 --- a/cf/w32-hh-toc-from-info.pl +++ b/cf/w32-hh-toc-from-info.pl @@ -56,7 +56,9 @@ my $tree = HTML::TreeBuilder->new(); $tree->parse_file($input_file); my $contents = $tree->look_down('class', 'contents'); -my $clist = $contents->find_by_tag_name('ul'); +if (defined($contents)) { + my $clist = $contents->find_by_tag_name('ul'); +} print TOC ' @@ -79,6 +81,8 @@ sub process_ul_element my $e = shift; my $level = shift; + return unless defined($e); + if ($e->tag() eq "ul") { print TOC ' 'x$level;