diff --git a/functions/src/update-metrics.ts b/functions/src/update-metrics.ts index eb5f6fd8..bb037e9c 100644 --- a/functions/src/update-metrics.ts +++ b/functions/src/update-metrics.ts @@ -187,7 +187,7 @@ export async function updateMetricsCore() { (e) => contractsById[e.contractId] ) const bets = groupContracts.map((e) => { - if (e.id in betsByContract) { + if (e != null && e.id in betsByContract) { return betsByContract[e.id] ?? [] } else { return []