From 4044e4e5a6a79414cd4b92f88d9e0cbe358daeb2 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 5 Oct 2025 20:38:44 -0700 Subject: [PATCH] fix battle table + $exit edge case --- src/ReceiveCommands.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 3348efdf..9b2bee00 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1849,7 +1849,14 @@ static void on_ep3_battle_table_state_updated(shared_ptr l, int16_t table static asio::awaitable on_E4_Ep3(shared_ptr c, Channel::Message& msg) { const auto& cmd = check_size_t(msg.data); - auto l = c->require_lobby(); + + // This command can be received shortly after a proxy session closes if the + // player uses $exit while standing on a battle table pad. In that situation, + // the player will not be in any lobby, so we just ignore the command. + auto l = c->lobby.lock(); + if (!l) { + co_return; + } if (cmd.seat_number >= 4) { throw runtime_error("invalid seat number");