Fix: nil check player

This commit is contained in:
Grail Finder
2025-07-08 12:21:40 +03:00
parent 587adfbbda
commit 8f6a093ea1
3 changed files with 695 additions and 1 deletions

View File

@ -26,6 +26,9 @@ func createRoom(ctx context.Context, req *models.RoomReq) (*models.Room, error)
func saveFullInfo(ctx context.Context, fi *models.FullInfo) error {
// INFO: no transactions; so case is possible where first object is updated but the second is not
if fi.State == nil {
return errors.New("player is nil")
}
if err := repo.PlayerUpdate(ctx, fi.State); err != nil {
return err
}