From 2eb4770bdd0cc1137e94c9f4204bce3edb4434b5 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 17 Dec 2022 01:16:22 -0800 Subject: [PATCH] fix handling of stray ep3 lobby counter state commands --- src/ReceiveCommands.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index d29f881d..8f7224a9 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1184,7 +1184,14 @@ static void on_ep3_battle_table_confirm(shared_ptr s, static void on_ep3_counter_state(shared_ptr s, shared_ptr c, uint16_t, uint32_t flag, const string& data) { // DC check_size_v(data.size(), 0); - auto l = s->find_lobby(c->lobby_id); + + shared_ptr l; + try { + l = s->find_lobby(c->lobby_id); + } catch (const out_of_range&) { + return; + } + if (flag != 0) { send_command(c, 0xDC, 0x00); if (l->tournament_match) {