From fbb367917ce202a89435e2a9ba620d49b25108ac Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 21 May 2020 02:02:01 +0200 Subject: [PATCH] fix #98136 --- .../workbench/services/keybinding/common/keybindingEditing.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index e12809176fe..57e202a9b12 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -230,10 +230,12 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding if (model.getValue()) { const parsed = this.parse(model); if (parsed.parseErrors.length) { + reference.dispose(); return Promise.reject(new Error(localize('parseErrors', "Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again."))); } if (parsed.result) { if (!isArray(parsed.result)) { + reference.dispose(); return Promise.reject(new Error(localize('errorInvalidConfiguration', "Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again."))); } } else { -- GitLab