fix another crash

This commit is contained in:
Adam 2024-09-02 15:45:23 -04:00
parent 98fa49046a
commit c810524b0d

View file

@ -195,6 +195,14 @@ impl Game {
// Start judging if this is last player to submit
if self.judge_pile_meta.len() == self.players.len() - 1 {
for group in self.judge_pile_meta.keys() {
for card_id in group {
if !self.judge_pile.contains_key(card_id) {
tracing::error!("Trying to judge a card not in play");
return Err("Trying to judge a card not in play".to_string());
}
}
}
Ok(Some((
JudgeRound {
cards_to_judge: self
@ -206,6 +214,7 @@ impl Game {
.iter()
.map(|id| {
let card = self.judge_pile.get(id).unwrap().clone();
// TODO: Make sure card exists
WhiteCardMeta {
uuid: card.uuid.to_string(),
text: card.text.clone(),