From 7d9908dbd0dd46b73ffadfabaaec6ac415d20849 Mon Sep 17 00:00:00 2001 From: Pico2x Date: Mon, 12 Sep 2022 20:58:12 +0100 Subject: [PATCH] Fix type error in update-metrics --- functions/src/update-metrics.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/src/update-metrics.ts b/functions/src/update-metrics.ts index 4352e872..eb5f6fd8 100644 --- a/functions/src/update-metrics.ts +++ b/functions/src/update-metrics.ts @@ -187,7 +187,11 @@ export async function updateMetricsCore() { (e) => contractsById[e.contractId] ) const bets = groupContracts.map((e) => { - return betsByContract[e.id] ?? [] + if (e.id in betsByContract) { + return betsByContract[e.id] ?? [] + } else { + return [] + } }) const creatorScores = scoreCreators(groupContracts)