Skip to content

Commit

Permalink
#436 Fix for some test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mliebelt committed Apr 23, 2023
1 parent dd77cb6 commit 38b3a0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/pgn-reader/src/pgn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ export class PgnReader {
return this.getMoves()[move.prev] && (this.getMoves()[move.prev].variations.length > 0)
}
writePgn(configuration:PgnWriterConfiguration = {}): string {
if (! this.currentGameIndex) return ""
return writeGame(this.getGame(this.currentGameIndex), configuration)
if (this.getGames().length === 0) return ""
return writeGame(this.getGame(this.currentGameIndex) || 0, configuration)
}

/**
Expand Down

0 comments on commit 38b3a0c

Please sign in to comment.