Deal with strange PGN download failures.
[remoteglot] / remoteglot.pl
index 63cdac2..917a6a0 100755 (executable)
@@ -268,7 +268,7 @@ sub handle_pgn {
        }
 
        my $pgn = Chess::PGN::Parse->new(undef, $body);
-       if (!defined($pgn) || !$pgn->read_game()) {
+       if (!defined($pgn) || !$pgn->read_game() || $body !~ /^\[/) {
                warn "Error in parsing PGN from $url\n";
        } else {
                eval {