From a7efda6fba311cdd7c66f3c2306b985b07840720 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Wed, 8 Jan 2025 16:25:56 -0800 Subject: [PATCH] fix conditional check for getEtaForShuttleAndStopId --- src/repositories/ApiBasedRepository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repositories/ApiBasedRepository.ts b/src/repositories/ApiBasedRepository.ts index 3b8100e..788e334 100644 --- a/src/repositories/ApiBasedRepository.ts +++ b/src/repositories/ApiBasedRepository.ts @@ -73,7 +73,7 @@ export class ApiBasedRepository implements GetterRepository { } await this.updateEtasForSystemIfTTL(systemId); - if (this.cache?.etasForStopId !== undefined) { + if (this.cache?.etasForStopId && this.cache.etasForStopId[systemId]) { const etas = this.cache.etasForStopId[systemId]; const foundEta = etas.find((eta) => eta.stopId === stopId); if (foundEta) {