]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Google.pl
* Accidentally left in a debug output
[infobot.git] / src / Modules / Google.pl
index 1fab907e866ff0dee3e933edf99eaac177dba958..a8a66f93de1cdf2b4347e68c6fea0b0861d0ef5f 100644 (file)
@@ -36,11 +36,18 @@ sub GoogleSearch {
         return;
     }
 
+    # No results found
+    if ( not $Search->responseData->results ) {
+        &::DEBUG( "Google::GoogleSearch> $retval" );
+        &::msg( $::who, $retval);
+        return;
+    }
+
     my $data    = $Search->responseData;
     my $cursor  = $data->cursor;
     my @results = $data->results;
-
     my $count;
+
     $retval = "$where says \"\002$what\002\" is at ";
     foreach my $r (@results) {
         my $url = $r->url;