From e82e53816c79279bb610ec1f73bfa47fcbf844ff Mon Sep 17 00:00:00 2001 From: 121593 <44259105+121593@users.noreply.github.com> Date: Wed, 10 Dec 2025 18:05:41 +0100 Subject: [PATCH] fix: stationBoard `entries` can be nullish When no entries are present an error was thrown when calling `entries.flat()` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b26e9345..2781fbef 100644 --- a/index.js +++ b/index.js @@ -111,7 +111,7 @@ const createClient = (profile, userAgent, opt = {}) => { const {res} = await profile.request({profile, opt}, userAgent, req); const ctx = {profile, opt, common, res}; - let results = (res[resultsField] || res.items || res.bahnhofstafelAbfahrtPositionen || res.bahnhofstafelAnkunftPositionen || res.entries.flat()) + let results = (res[resultsField] || res.items || res.bahnhofstafelAbfahrtPositionen || res.bahnhofstafelAnkunftPositionen || res.entries?.flat() || []) .map(res => parse(ctx, res)); // TODO sort?, slice if (!opt.includeRelatedStations) {