diff --git a/scripts/helpers/latestversion.js b/scripts/helpers/latestversion.js index 2b16773112274..f41a668c4bd79 100644 --- a/scripts/helpers/latestversion.js +++ b/scripts/helpers/latestversion.js @@ -11,11 +11,11 @@ const map = (release) => release && { } exports.current = (releases) => { - const match = releases.find((release) => !release.lts && semver.gte(release.version, '5.0.0')) + const match = releases && releases.find((release) => !release.lts && semver.gte(release.version, '5.0.0')) return map(match) } -exports.lts = (releases) => map(releases.find((release) => release.lts)) +exports.lts = (releases) => map(releases && releases.find((release) => release.lts)) function majorStr (release) { return `v${semver.major(release.version)}.x`