Skip to content

Commit 777b472

Browse files
committed
fix: catch invalid saved config file uri
1 parent 73fd44f commit 777b472

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

extensions/cli/src/configLoader.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ function determineConfigSource(
103103

104104
if (savedUri) {
105105
if (savedUri.startsWith("file:")) {
106-
if (fs.existsSync(fileURLToPath(savedUri))) {
107-
return { type: "saved-uri", uri: savedUri };
108-
} else {
109-
logger.warn("Saved config URI does not exist: " + savedUri);
106+
try {
107+
if (fs.existsSync(fileURLToPath(savedUri))) {
108+
return { type: "saved-uri", uri: savedUri };
109+
} else {
110+
logger.warn("Saved config URI does not exist: " + savedUri);
111+
}
112+
} catch (e) {
113+
logger.warn("Invalid saved file URI " + savedUri);
110114
}
111115
} else {
112116
// slug

0 commit comments

Comments
 (0)