Skip to content

Commit f56e8e1

Browse files
committed
Protect from empty package array
1 parent dd61714 commit f56e8e1

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

dist/index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/report.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ function isSeverityGte(a: string, b: string): boolean {
217217
}
218218

219219
export function filterPackages(pkgs: Package[], filters: FilterOptions): Package[] {
220+
if (!Array.isArray(pkgs)) return [];
220221
return pkgs
221222
.filter(pkg => {
222223
const pkgType = pkg.type?.toLowerCase();

0 commit comments

Comments
 (0)