From ac992c7d813ba7489cdd58b7391ba1b11a5f031a Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 18 Jan 2024 15:21:04 -0500 Subject: [PATCH] Fix undefined crash --- .github/scripts/utils/get-provides.ts | 2 +- src/pkgx.dev/PackageListing.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/utils/get-provides.ts b/.github/scripts/utils/get-provides.ts index 2b9d206..90d52fb 100644 --- a/.github/scripts/utils/get-provides.ts +++ b/.github/scripts/utils/get-provides.ts @@ -10,7 +10,7 @@ export default function get_provides(yml: any): string[] { provides = [] const set = new Set() for (const x of [darwin, linux, windows, star].flatMap(x => x)) { - if (!set.has(x)) { + if (!set.has(x) && x) { provides.push(x) set.add(x) } diff --git a/src/pkgx.dev/PackageListing.tsx b/src/pkgx.dev/PackageListing.tsx index 9a9898e..2791e4e 100644 --- a/src/pkgx.dev/PackageListing.tsx +++ b/src/pkgx.dev/PackageListing.tsx @@ -329,7 +329,7 @@ function get_provides(yml: any): string[] { provides = [] const set = new Set() for (const x of [darwin, linux, windows, star].flatMap(x => x)) { - if (!set.has(x)) { + if (!set.has(x) && x) { provides.push(x) set.add(x) }