Skip to content

Commit

Permalink
pgn: Skip over invalid or malformed headers
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 authored and niklasf committed Jul 11, 2022
1 parent 865e467 commit 835c520
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chess/pgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,9 @@ def read_game(handle: TextIO, *, Visitor: Any = GameBuilder) -> Any:
if unmanaged_headers is not None:
unmanaged_headers[tag_match.group(1)] = tag_match.group(2)
else:
break
# Ignore invalid or malformed headers.
line = handle.readline()
continue

line = handle.readline()

Expand Down

0 comments on commit 835c520

Please sign in to comment.