Skip to content

Commit 98ec12f

Browse files
committed
check that found chrome / edge program exists.
1 parent 0d07895 commit 98ec12f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/puppeteer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { readRegistryKey } from "./windows.ts";
99
import { which } from "./path.ts";
1010
import { error, info } from "log/mod.ts";
1111
import { fetcher } from "../command/tools/tools/chromium.ts";
12+
import { existsSync } from "https://deno.land/[email protected]/fs/mod.ts";
1213

1314
// deno-lint-ignore no-explicit-any
1415
let puppeteerImport: any = undefined;
@@ -216,7 +217,7 @@ async function findChrome(): Promise<string | undefined> {
216217
programs[i],
217218
"(Default)",
218219
);
219-
if (path) break;
220+
if (path && existsSync(path)) break;
220221
}
221222

222223
// Try the HKCR key
@@ -229,7 +230,7 @@ async function findChrome(): Promise<string | undefined> {
229230
);
230231
path = path?.match(/"(.*)"/);
231232
path = path ? path[1] : undefined;
232-
if (path) break;
233+
if (path && existsSync(path)) break;
233234
}
234235
}
235236
}

0 commit comments

Comments
 (0)