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) {