From 7194f0622fdfb41248c94bcf7d1ba18b732e1f4b Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Fri, 16 Mar 2012 21:05:59 +0000 Subject: [PATCH] avoid lots of "uninitialized value" warnings when searching packages that do not have previews --- lib/CPAN/Mini/Webserver.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/CPAN/Mini/Webserver.pm b/lib/CPAN/Mini/Webserver.pm index 1a0a15c..9f9bd96 100644 --- a/lib/CPAN/Mini/Webserver.pm +++ b/lib/CPAN/Mini/Webserver.pm @@ -366,6 +366,7 @@ sub _add_search_preview { $content =~ s/\s+/ /g; my ( $match ) = ( $content =~ /($q)/i ); + return if not defined $match; my $length = length $match; my $pos = index $content, $match;