feat: guard against empty terms in createGameSession
This commit is contained in:
parent
1e30f04e81
commit
3d16ab0fff
4 changed files with 62 additions and 0 deletions
|
|
@ -25,6 +25,10 @@ export const createGameSession = async (
|
|||
request.rounds,
|
||||
);
|
||||
|
||||
if (terms.length === 0) {
|
||||
throw new NotFoundError("No terms found for the given filters");
|
||||
}
|
||||
|
||||
const answerKey = new Map<string, number>();
|
||||
|
||||
const questions: GameQuestion[] = await Promise.all(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue