Throw useful error if task execution is undefined

https://github.com/microsoft/vscode/issues/109861
This commit is contained in:
Alex Ross 2020-11-03 11:37:51 +01:00
parent 5905725b5c
commit 7d1affcf90
2 changed files with 8 additions and 0 deletions

View file

@ -705,6 +705,10 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
}
public async executeTask(extension: IExtensionDescription, task: vscode.Task): Promise<vscode.TaskExecution> {
if (!task.execution) {
throw new Error('Tasks to execute must include an execution');
}
const dto = TaskDTO.from(task, extension);
if (dto === undefined) {
throw new Error('Task is not valid');

View file

@ -50,6 +50,10 @@ export class ExtHostTask extends ExtHostTaskBase {
}
public async executeTask(extension: IExtensionDescription, task: vscode.Task): Promise<vscode.TaskExecution> {
if (!task.execution) {
throw new Error('Tasks to execute must include an execution');
}
const tTask = (task as types.Task);
// We have a preserved ID. So the task didn't change.
if (tTask._id !== undefined) {