Skip to content

Commit 2658c81

Browse files
authored
fix out of bounds error (#86)
1 parent 6fc0e40 commit 2658c81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

piece.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ func (p Piece) Color() Color {
244244

245245
// String implements the fmt.Stringer interface.
246246
func (p Piece) String() string {
247+
if p == NoPiece {
248+
return "-"
249+
}
247250
return pieceUnicodes[int(p)]
248251
}
249252

0 commit comments

Comments
 (0)