diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index 78861625e1a0c..a0c923e80784a 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -21,8 +21,7 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding { super(); this._os = OS; if (actual === null) { - this._firstPart = null; - this._chordPart = null; + throw new Error(`Invalid USLayoutResolvedKeybinding`); } else if (actual.type === KeybindingType.Chord) { this._firstPart = actual.firstPart; this._chordPart = actual.chordPart; diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index 2bb8da1d89024..1c56f4f0dde0d 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -74,6 +74,9 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding { constructor(mapper: MacLinuxKeyboardMapper, OS: OperatingSystem, firstPart: ScanCodeBinding, chordPart: ScanCodeBinding) { super(); + if (!firstPart) { + throw new Error(`Invalid USLayoutResolvedKeybinding`); + } this._mapper = mapper; this._OS = OS; this._firstPart = firstPart; diff --git a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts index 02c1dac816cc3..869932b1b18d1 100644 --- a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts @@ -86,6 +86,9 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { constructor(mapper: WindowsKeyboardMapper, firstPart: SimpleKeybinding, chordPart: SimpleKeybinding) { super(); + if (!firstPart) { + throw new Error(`Invalid WindowsNativeResolvedKeybinding firstPart`); + } this._mapper = mapper; this._firstPart = firstPart; this._chordPart = chordPart;