commit 8bba6d9c494d4cae053b42b1a5613ed33dde4a73
parent 5db8bfa5dbe7c11c2539934ea3bfa21da9ecf611
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 06:52:01 -0500
cleanup
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -845,8 +845,7 @@ func PokerHomeHandler(c echo.Context) error {
pokerTableSlug := c.Request().PostFormValue("table_slug")
playerBuyIn := database.PokerChip(utils.DoParseUint64(c.Request().PostFormValue("buy_in")))
if err := db.WithE(func(tx *database.DkfDB) error {
- g := poker.PokerInstance.GetGame(poker.RoomID(pokerTableSlug))
- if g != nil {
+ if g := poker.PokerInstance.GetGame(poker.RoomID(pokerTableSlug)); g != nil {
g.Players.Lock()
defer g.Players.Unlock()
if g.IsSeated2(authUser.Username) {
@@ -888,8 +887,7 @@ func PokerHomeHandler(c echo.Context) error {
} else if formName == "cash_out" {
pokerTableSlug := c.Request().PostFormValue("table_slug")
if err := db.WithE(func(tx *database.DkfDB) error {
- g := poker.PokerInstance.GetGame(poker.RoomID(pokerTableSlug))
- if g != nil {
+ if g := poker.PokerInstance.GetGame(poker.RoomID(pokerTableSlug)); g != nil {
g.Players.Lock()
defer g.Players.Unlock()
if g.IsSeated2(authUser.Username) {