Skip to content

Commit

Permalink
Reject invalid URI with vscode.openFolder (for #55891)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Aug 7, 2018
1 parent 57298ff commit 5ddf33c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vs/workbench/api/node/apiCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class OpenFolderAPICommand {
if (!uri) {
return executor.executeCommand('_files.pickFolderAndOpen', forceNewWindow);
}
if (!uri.scheme) {
throw new Error(`Invalid URI, schema required: '${uri.toString()}'.`);
}

return executor.executeCommand('_files.windowOpen', [uri], forceNewWindow);
}
Expand Down

0 comments on commit 5ddf33c

Please sign in to comment.