Skip to content

Commit f492cd9

Browse files
committed
Emu: Adding some logging because something is breaking on the front end but not locally
1 parent d21b6b5 commit f492cd9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/games/emu.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export const getBirdSuits = (bird: string[]): string[] => {
9595

9696
export const canGrowBird = (bird: string[], card: string): boolean => {
9797
const cards = bird.map(c => Card.deserialize(c)!);
98-
const cardObj = Card.deserialize(card)!;
98+
const cardObj = Card.deserialize(card);
99+
if (cardObj === undefined) {
100+
throw new Error(`Could not deserialize the card ${card}. Bird: ${JSON.stringify(bird)}`);
101+
}
99102

100103
// suits first
101104
// find suits of initial card

0 commit comments

Comments
 (0)