diff --git a/src/services/trainService.services.ts b/src/services/trainService.services.ts index 59c7598..449758c 100644 --- a/src/services/trainService.services.ts +++ b/src/services/trainService.services.ts @@ -98,7 +98,7 @@ async function fetchPisCode( } // Check if no public stops - then it should use an ECS headcode let pisData: OB_Pis_SimpleObject | null - if (tiplocList) { + if (tiplocList.length) { pisData = await findByTiplocArray(tiplocList); } else { pisData = {