Gracefully handle decodeURIComponent failure
This commit is contained in:
parent
789f65c9ee
commit
cc5f2fb439
3 changed files with 17 additions and 3 deletions
|
|
@ -201,7 +201,14 @@ export function resolveUriToFile(
|
|||
logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
|
||||
return undefined;
|
||||
}
|
||||
let uri = decodeURIComponent(location.uri as string);
|
||||
|
||||
let uri: string;
|
||||
try {
|
||||
uri = decodeURIComponent(location.uri as string);
|
||||
} catch (e: any) {
|
||||
logger.debug(`Ignoring location as URI "${location.uri}" is invalid`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Remove a file scheme, and abort if the scheme is anything else
|
||||
const fileUriPrefix = "file://";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue