view_hand being sent and panicking causes logged_out or something else to fail?

This commit is contained in:
Tao Tien 2026-02-25 14:34:05 -08:00
parent baab16144b
commit c68af245af
3 changed files with 6 additions and 4 deletions

View file

@ -139,8 +139,9 @@ pub struct HandView {
#[view(accessor = view_closed_hands, public)]
fn view_closed_hands(ctx: &ViewContext) -> Vec<HandView> {
let this_player = ctx.db.player().identity().find(ctx.sender()).unwrap();
if let Some(lobby) = ctx.db.lobby().id().find(this_player.lobby_id) {
if let Some(this_player) = ctx.db.player().identity().find(ctx.sender())
&& let Some(lobby) = ctx.db.lobby().id().find(this_player.lobby_id)
{
lobby
.players
.iter()