X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/utils/blobdiff_plain/67784f1f3e5992d8f43ca5006f0e6d8fb19949ea..1a88a03e1fd012bde266c95fa326730e7f057e47:/nntpid/nntpid diff --git a/nntpid/nntpid b/nntpid/nntpid index ffdde0d..015b277 100755 --- a/nntpid/nntpid +++ b/nntpid/nntpid @@ -137,8 +137,10 @@ if ($mode eq 'all') { $fatal = 0; # ignore failure to retrieve any given article for ($mid = $numbers[1]; $mid <= $numbers[2]; $mid++) { $art = &getart("$group:$mid"); - $art =~ s/\n(>*From )/\n>$1/gs; - print "From nntpid ".(localtime)."\n".$art."\n"; + if (defined $art) { + $art =~ s/\n(>*From )/\n>$1/gs; + print "From nntpid ".(localtime)."\n".$art."\n"; + } } } elsif ($mode eq 'stdin') { while (<>) { @@ -178,6 +180,7 @@ sub displayarticle { &connect; my $art = &getart($mid); + return unless defined $art; if ($pager and -t STDOUT) { # Close the NNTP connection before invoking the pager, in case the