mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Fixes #8379: validate column argument of vscode.previewHtml
This commit is contained in:
@@ -85,13 +85,20 @@ export class ExtHostCommands {
|
||||
if (!command) {
|
||||
return Promise.reject<T>(`Contributed command '${id}' does not exist.`);
|
||||
}
|
||||
try {
|
||||
let {callback, thisArg, description} = command;
|
||||
if (description) {
|
||||
for (let i = 0; i < description.args.length; i++) {
|
||||
|
||||
let {callback, thisArg, description} = command;
|
||||
|
||||
if (description) {
|
||||
for (let i = 0; i < description.args.length; i++) {
|
||||
try {
|
||||
validateConstraint(args[i], description.args[i].constraint);
|
||||
} catch (err) {
|
||||
return Promise.reject<T>(`Running the contributed command:'${id}' failed. Illegal argument '${description.args[i].name}' - ${description.args[i].description}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
let result = callback.apply(thisArg, args);
|
||||
return Promise.resolve(result);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user