&a_href_cc: Allow the case of undefined {""} - it is sometimes needed.
[MyWeb.git] / Web.pm
diff --git a/Web.pm b/Web.pm
index d84cadc..5bc71e0 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -907,7 +907,9 @@ my($url,$contents,%args)=@_;
 
        # A bit ineffective but we must process all the possibilities to get stable 'headers_in' hits!
        my %map=map(($_=>a_href($url->{$_},$contents,%args)),keys(%$url));
-       my $r=$map{_cc()};
+       my $r;
+       $r||=$map{_cc()};
+       $r||=$map{""};
        return $r if $r;
        return $contents;
 }
@@ -918,7 +920,11 @@ sub text_cc($)
 {
 my($tree)=@_;
 
-       return $tree->{_cc()};
+       cluck if !$tree->{""};
+       my $r;
+       $r||=$tree->{_cc()};
+       $r||=$tree->{""};
+       return $r;
 }
 
 sub make ($)