From d7d888e3261071831f61167e9361b5360a6700bf Mon Sep 17 00:00:00 2001 From: Demin Dmitriy Date: Mon, 21 Mar 2022 02:37:56 +0300 Subject: [PATCH] fix invalid request to /end when game ended in a draw In `board.snakes` there would be `null` instead of `[]`. --- cli/commands/play.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/commands/play.go b/cli/commands/play.go index ea7f1d3..b89aadc 100644 --- a/cli/commands/play.go +++ b/cli/commands/play.go @@ -392,7 +392,7 @@ func convertRulesSnake(snake rules.Snake, snakeState SnakeState) client.Snake { } func convertRulesSnakes(snakes []rules.Snake, snakeStates map[string]SnakeState) []client.Snake { - var a []client.Snake + a := make([]client.Snake, 0) for _, snake := range snakes { if snake.EliminatedCause == rules.NotEliminated { a = append(a, convertRulesSnake(snake, snakeStates[snake.ID]))