diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 8ebc7ed2ad0443352ae9aca45757a1938a08e34a..f45b71a55647cf431ca37c4f2fcb6fbe1c965b93 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -1277,7 +1277,7 @@ class TaskService extends EventEmitter implements ITaskService { } private getConfiguration(): { config: TaskConfig.ExternalTaskRunnerConfiguration; hasParseErrors: boolean } { - let result = this.configurationService.getConfiguration('tasks', { resource: this.contextService.getWorkspace().resource }); + let result = this.contextService.hasWorkspace() ? this.configurationService.getConfiguration('tasks', { resource: this.contextService.getWorkspace().resource }) : undefined; if (!result) { return { config: undefined, hasParseErrors: false }; }