diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 87fc94481a3..0f44ca6f3c1 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1359,7 +1359,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }, onDidStartTask: (listeners, thisArgs?, disposables?) => { if (!isProposedApiEnabled(extension, 'taskExecutionTerminal')) { - thisArgs.terminal = undefined; + if (thisArgs) { + thisArgs.terminal = undefined; + } } return _asExtensionEvent(extHostTask.onDidStartTask)(listeners, thisArgs, disposables); },