Skip to content

Commit a26023b

Browse files
committed
fix: error was thrown when --ignorefile was not given
1 parent 238d62c commit a26023b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cli.ts

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export function formatFileProperties(
4040
export async function getNonEmptyLinesFromFile(
4141
filePath: string
4242
): Promise<string[]> {
43+
if (!filePath) {
44+
return [];
45+
}
4346
const content = await readFile(filePath, "utf8");
4447
return (
4548
parseNewLineSeparatedValues(content)
@@ -51,6 +54,9 @@ export async function getNonEmptyLinesFromFile(
5154
export async function getNonEmptyLinesFromFiles(
5255
filePaths: string[]
5356
): Promise<string[]> {
57+
if (!filePaths) {
58+
return [];
59+
}
5460
const promises = filePaths.map((fp) => getNonEmptyLinesFromFile(fp));
5561
const results = await Promise.all(promises);
5662
return results.flat().filter(Boolean);

0 commit comments

Comments
 (0)