diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts index 5d6073ed45119b52c4207af70fe036dd9a8b5a67..0c2b2904f64685f10f8fd471797f44da9b9a4140 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts @@ -170,7 +170,7 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ // And persist the setting if (pick) { const newAssociation: CustomEditorAssociation = { viewType: pick, filenamePattern: '*' + resourceExt }; - const currentAssociations = [...this.configurationService.getValue(customEditorsAssociationsSettingId)] || []; + const currentAssociations = [...this.configurationService.getValue(customEditorsAssociationsSettingId)]; // First try updating existing association for (let i = 0; i < currentAssociations.length; ++i) { diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 919bb81e5444087cf1bb1c162c16105d1761ba9c..5608ef032570bb16187496c9686d19ec7b99771c 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -608,7 +608,7 @@ export class ReopenResourcesAction extends Action { // And persist the setting if (pick && id) { const newAssociation: CustomEditorAssociation = { viewType: id, filenamePattern: '*' + resourceExt }; - const currentAssociations = [...this.configurationService.getValue(customEditorsAssociationsSettingId)] || []; + const currentAssociations = [...this.configurationService.getValue(customEditorsAssociationsSettingId)]; // First try updating existing association for (let i = 0; i < currentAssociations.length; ++i) {