From 2073b4d1f06ed02e7ca579b7403546e46e498541 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 29 Sep 2021 15:44:01 -0400 Subject: [PATCH] don't allow commands to be played in nil games --- internal/coordinator/coordinator.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/coordinator/coordinator.go b/internal/coordinator/coordinator.go index ad99dd3..664ee6d 100644 --- a/internal/coordinator/coordinator.go +++ b/internal/coordinator/coordinator.go @@ -98,6 +98,13 @@ func (c *Coordinator) Coordinate(cmd *SessionCommand) *SessionCommandResult { Result: SessionRespLeft, } } + if m.Game == nil { + return &SessionCommandResult{ + ID: cmd.ID, + MatchID: m.ID, + Result: SessionRespError, + } + } resp := m.Play(cmd.ID, cmd.GameCommand) return &SessionCommandResult{ ID: cmd.ID,